I am trying to use conditional formatting to highlight which of the cells in a row are today's date. I am using the formula:
=G2=(TODAY()) and the range is Sheet1!$G$2:$G$10.
However only the first cell in a column is highlighted even when the same date is listed below.
On a very similar formatting formula (=E2="High" on the range E2:E10) the formula seems to work a treat! I can't work out why there is a difference.
Thanks,
Alex
Please try:
=G2=TODAY()
(but only because one set of parentheses is not required!) and for Applies to:
=$G$2:$G$10
The Applies to range has to be in the same sheet as is G2 in your formula.
I suspect if you go back to the Conditional Formatting Rules Manager you will see that what you entered was automatially removed (substituted by =$G$2, hence the one cell that 'works').
Related
How to highlight cells that have a specific formula.
E.g cells that have a formula of "vlookup".
I knew search/replace can always look into formulas. But how to look into formula for conditional formatting?
Using conditional formatting, based on this kind of formula:
=FIND("VLOOKUP";FORMULATEXT(...))
Keep in mind that find() seems to be case sensitive.
More elaborated: imagine you have a formula with VLOOKUP() in cell B2. On the cell you want to highlight, you can use conditional formatting (Home ribbon, Conditional formatting, Highlighting cell rules, More rules, "Use a formula"), and as a formula, you use the following:
=IFERROR(FIND("VLOOKUP";FORMULATEXT(B2));FALSE)>0
Explanation:
FIND() searches for the word "VLOOKUP" in cell B2 (mind the uppercase).
FORMULATEXT() converts the formula in normal text, and can be used as input for FIND().
In case the word "VLOOKUP" is not found, an error is shown.
The IFERROR() function deals with the error, showing FALSE as a result.
The "greater than" check makes sure that the formula results in TRUE, enabling the formula for the conditional formatting.
In the below example we use:
"=VLOOKUP" in column B to get the value of Column A from the range in H3:I3.
"=FORMULATEXT" in Column C to get the value of Column B.
"=IF((IFERROR(FIND("VLOOKUP",C2,1),0))>0,"Appears","Not Appears")" in Column E to check if words "VLOOKUP" appears in Column C.
Images:
Edited from #Dominique suggestions and it seems working.
'=IF(FIND("VLOOKUP",FORMULATEXT(A1)),TRUE)'
What I am trying to achieve is if a cell in column AB equals "Yes" and a cell in column AC is blank, then a certain range of cells will be formatted. Currently the rule is not formatting cells that it should. I am basing this code on another formatting rule I am using that works properly, but does not use AND().
=AND(INDIRECT("ab"&ROW())="Yes", INDIRECT("ac"&ROW())="")
I am sure this is an obvious syntax mistake, but I am still very new to Excel and can't figure out why this isn't working.
Try This:
=AND($AB1="YES",$AC1="")
Use the format painter to drag the formula around.
As Jeeped said, change the 1 in $AB1 and $AC1 to your first row.
I am formatting cell D25 using the following conditional formatting formula:
=(VLOOKUP($C25;$C$6:$L$18;2)+D25)>32
When applying the formula to the adjacent column I get formula updates to
=(VLOOKUP($C25;$C$6:$L$18;**2**)+E25)>32
Using the Copy and Paste Format function works mostly i.e. references in the formula are updated as I would expect.
The only (essential) thing that doesn't update is the INDEX value in the VLOOKUP formula. I would expect this value to increase by 1 when copying the format to the next column - it doesn't.
Is there any way to go around this issue with VLOOKUP? Is there a better suited formula to achieve the same result?
Any help will be greatly appreciated!!
This value does not increase automatically, and it is good. This formula was designed to be used on Tables, so consistency is a point here.
For conditional formatting, you may want to use $ to lock some references. For example, let we have the simple sheet as below:
First, select the range in the CORRECT order. This is important. the first cell you select will be reference for offsets of the conditional formatting. For this example, let's do it like this:
Now, let's go for the conditional formatting itself! Conditional Formatting > New Rule... > Use a formula to determine which cells to format. And let's put this formula:
=if($A1<=2;TRUE;FALSE)
Click OK and...
There we go! We just formatted the lines in witch An is equal or less than 2! Please note that we only had to lock the COLUMN of the reference. So, logically, to format the columns we would have locked the ROW.
Hope it helps!
EDIT:
If you REALLY want to use VLOOKUP, which I DO NOT recommend, you can just use the formula:
=(VLOOKUP($C25;$C$6:D$18;COLUMNS($C$6:D$18))+E25)>32
To change the index dinamically.
I have to use the following formula to format a cell based on a range of cells.
=IF($D$35=$AD$34+$A$3,1,IF($D$36=$AD$34+$A$3,1,IF($D$37=$AD$34+$A$3,1,IF($D$38=$AD$34+$A$3,1,IF($D$39=$AD$34+$A$3,1,IF($D$40=$AD$34+$A$3,1,IF($D$41=$AD$34+$A$3,1,IF($D$42=$AD$34+$A$3,1,IF($D$43=$AD$34+$A$3,1,0)))))))))
The range of cells is D35 to D43. The condition to be met is a specific date (designated by AD34+A3). The formula above works perfectly. However, I know there is a better way. I have tried using INDIRECT, and OFFSET commands to specify the range of cells. I have not been able to get the syntax right.
I have worked on this for days, can someone please show me what i am missing? I would prefer a solution that does not require VBL.
=IFERROR(MATCH(AD34+A3,D35:D43,0),0)
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.