I use conditional formatting to format a cell depending on the values of another cell. This is the rule:
Cell Value not between =$BV$10*0,5 and =$BV$10*0,5
This rule is saved on Cell Y10
(Explanation: If the Value in Y10 is inbetween 0,5...1,5 * BV10 apply the formatting)
I want to use this rule on many different Cells but the formula should adjust automaticly, just like in a "normal" formula.
When I copy the format using the Format Painter the formula is copied without any changes. But I need the row to be changed. For example, when copying to Y11 the formula should be changed to :
=$BV$11*0,5
Is there any way to achieve this or to change $BV$10 into $[this column+83]$[this row] or something like that?
Yes. $ is used to lock the cell reference.
So to get what you need just change your formula to this unlocking the rows:
=$BV10*0,5 and =$BV10*1 ~~> I change the limits to actually test the formula
So if you want your column to move as well, then remove the other $ sign.
Also, you can explicitly apply this formatting to other cells by supplying the range in Applies To argument like below:
Take note that you can actually put the formatting in any cell.
But the effect will always be on the Range you explicitly define in Applies to.
I discourage using the Copy Paste Format as this sometimes overlaps formattings you've done.
To apply the formatting to a group of different range, just separate the ranges with a , comma like what you see below:
So the formatting will then be applied to $Z$10:$Z$20 as well.
It is the same as $Y$10:$Z$20, but I just want to point out that it can be used to none contingous range.
And since your column is locked with your formatting, it will still be references to $BV(x) where x is the corresponding row in Y and Z.
Related
I have two columns to compare. All cell values come from the ROUNDUP function. =ROUNDUP(C6/D12,0) etc.
I want the larger, or equal, of the two in each row to be green and the smaller red. Using the formula, it does not work as expected. If I do the same with numbers typed, not the formula, it works. It appears the formatting applies to the formula and not the value.
That is the first half of the problem. I also want to autofill/paint the conditional formatting to numerous cells, but it always compares to the top left cell, rather than the two cells on the same row.
If I use the color scales formatting it works, but I do not want the scales, just red/green.
It seems hard to believe that what I want to do is not possible. Can someone please help me with this. Thanks in advance.
In conditional formatting, under 'use a formula to determine which cells to format', you need to enter
=A2=MAX($A2,$B2)
to highlight the larger cell and (as a separate rule)
=A2=MIN($A2,$B2)
to highlight the smaller cell.
Note that in the case where both cells have the same value, they will both be either coloured red or green depending on the precedence of the rules. If the 'green' rule comes first,
it will look like this:
Conditional formatting is almost its own little science within Excel. It may be more useful to find youtube tutorials on the topic than depend on a text explanation here. But the central theme is this.
You will use location locking (the dollar sign or F4) in front of the letters so that any cell to which the format is applied knows you specifically mean columns E and F, for instance.
Example: Assume your first row goes from A5 to M5, and the condition values are in E5 and F5.
I find it easiest to format one row with the rules I want, test them, and then use the format painter or copy -> paste format along with careful use of $ locking.
Drag over and select the entire row of cells A5:M5
Conditional Formatting -> New Rule -> Use a formula to determine which cells to format
In the formula field enter =$E5>$F5. Excel gets weird and often inserts double quotes. If you save the rule and go back in, it may say ="$E5>$F5" and if so delete the double quotes.
Click Format and create the cell format you want.
With A5:M5 still selected, add another rule and format for ="$E5<$F5"
The $ sign works the same way as it does in a formula. All of the columns get their format based on columns E and F, but all of the rows base their formula on the E and F values in that same row.
So here's my problem. I have a table of the numbers 1 through 100, and another cell (we'll call it A1) that will contain a number between 1 and 100. I would like to use conditional formatting to fill these cells, so if A1 contains the number 20, all of the cells from 1 to 20 will be filled. I am trying to use conditional formatting in order to achieve this, and would like to use the format painter if possible to make this easier (instead of making a new rule each time). I feel that the best way to accomplish this is to reference the current cell, i.e. format if CURRENT_CELL <= A1. I am struggling to reference the current cell.
You can use the Less Then and the Equal conditional formatting like you can see below.
There is no need for a custom rules.
I would like to know, if possible, how can the following be done: I have two cells with different inputs that change depending on filters.
Example:
A1 = 5
A2 = 7
A1 has a dynamic format that changes depending on its value.
The value of A2 also changes, however I would like to have the same cell color and font as A1 despite not having the same number.
Copy formatting is not an option as it is static.
Apply same formatting rules does not do the work as it has different values.
Maybe a macro that copies format of A1 to A2 every time change in value happens.
thanks in advance,
Kylian
You can apply the same conditional formatting to multiple cells:
To create a new rule:
1) Highlight A1:A2
2) Add a new rule with the following formula:
$A$1=5
(I assumed 5 is the value that triggers the rule)
To expand an existing rule, go to Conditional Formatting and edit the formula so it uses absolute referencing (i.e. add $ in front of the column and row: $A$1 instead of A1, then edit the range the rule applies to:
I have a sheet that looks like this:
The coloured cells need to be a specific colour based on their value. I am currently using conditional formatting to achieve this, but I am only able to get it to apply to a single column instead of the entire range A:G. For example, here’s my formula for column A for values that should be coloured light blue:
=OR($A1="CA515",$A1="CA525")
And applies to:
=$A:$A
Using the above formula, if any of the cells in column A contain the value CA515 or CA525, the cell alone is coloured light blue. Is there any way to use a single conditional formatting formula to make it possible that if any of the cells in the range A:G contain the value CA515 or CA525 that only that cell alone is coloured light blue? Or do I have to apply the formula to every column individually, or possibly even resort to VBA?
Thank you in advance!
You can avoid using VBA here*... Remove the dollar signs in your conditional statement, it should be
=OR(A1="CA515", A1="CA525")
The dollar signs specify whether the reference is relative or absolute. To visualise how this works, try typing these formulas into a cell and dragging the corner of the cell down to autofill:
=A1 'Autofilling this down will give =A2, =A3, ...
=$A1 'Autofilling this down will give =$A1, =$A1, ...
So by removing $, your format condition should be spread across the range. To set the range, change "applies to" to $A:$G.
Note: many conditional formats over a large range like this could severely impact the speed of your document. Consider at least limiting the number of different formats, or the number of rows it's checking.
*Although the above method does avoid VBA, it might be quicker to write your own formatting routine in VBA, since it wouldn't have to get checked so frequently and it would be unaffected by moving around of ranges which messes with conditional formats.
I have a condition set up =IF(C2<42,C4="") the background color will turn red if met.
When dragging the crosshair (at the bottom left of the cell) to neighbouring cells, the formula stays the same.
I need the formula to then change to =IF(D2<42,D4="") and so on 300+ times, Is there any way to refer to the current column i.e =IF(thiscolumn-row2 < 42, thiscolum-row4 = "")
Excel sometimes by default puts dollar signs in front of the cell/row labels
(ie $C$4 instead of C4 .... the dollar signs tell excel not to change the formula with each row but to lock in the original values. Does your rule in conditional formatting show dollar signs? That may be your problem. Get rid of the dollar signs and what you need should work.
You don't use If in Conditional Formatting formulas. The formula itself defines the condition that you are looking for, so the if is already implied. So your formula should simply be something like:
=C2<42
I'm confused about the 2nd part of your formula, C4="". Is that supposed to be a 2nd condition? If so, use an AND statement:
=AND(C2<42,C4="")
If you are using Excel 2007 or 2010 another source of potential confusion is that references don't change in the Conditional Formatting formula box when you drag them around, even if they are relative.
Assuming you want to apply formatting to the range c1:d300, select that range of cells, bring up the conditional formatting box and enter:
=AND(C2<42,C4="")
Now it will apply the formatting with relative references to the full selected range.