I am trying to create a formula for Excel whereby a cell would change colour based on the text in the previous cell.
So for example if cell B2 contains the letter X and then B3 is Y, I would like B3 to turn green.
Equally, if B2 contains X and B3 contains W I would like B3 to turn red.
Any ideas much appreciated!
Select cell B3 and click the Conditional Formatting button in the ribbon and choose "New Rule".
Select "Use a formula to determine which cells to format"
Enter the formula: =IF(B2="X",IF(B3="Y", TRUE, FALSE),FALSE), and choose to fill green when this is true
Create another rule and enter the formula =IF(B2="X",IF(B3="W", TRUE, FALSE),FALSE) and choose to fill red when this is true.
More details - conditional formatting with a formula applies the format when the formula evaluates to TRUE. You can use a compound IF formula to return true or false based on the values of any cells.
Select ColumnB and as two CF formula rules apply:
Green: =AND(B1048576="X",B1="Y")
Red: =AND(B1048576="X",B1="W")
Use conditional formatting.
You can enter a condition using any cell you like and a format to apply if the formula is true.
Related
I have a question concerning conditional formatting in excel:
I want to highlight one cell (lets say F1) in red but only if F6 it self is empty/blank and B1 is filled (it doesn't matter with what): How do I do it?
Use
=AND(ISBLANK(F6),NOT(ISBLANK(B1)))
or
=AND(F6="",B1<>"")
in conditional formatting.
Result:
Select cell F1
Open Conditional Formatting
Select "New rule" then "Use a formula"
Use a formula that results in TRUE or FALSE
In your case use =AND(ISBLANK(F6);NOT(ISBLANK(B1)))
I am trying to create a formula in Excel whereby a cell would change color based on the value in the previous cell.
for example if cell B2 contains value X and then B3 contains value Y, I would like B3 to turn green if B3> B2 else to turn red.
'Standard' fill red the relevant range and select Column B, clear any existing CF rules and HOME > Styles - Conditional Formatting, New Rule..., Use a formula to determine which cells to format and Format values where this formula is true::
=AND(B1>B1048576,ROW()<>1)
Format..., select green fill, OK, OK.
I am assuming your column is labelled.
I want to create an excel sheet using conditional format, where user can fill either cell A1(say) or A2(say). If he fill both then both cells becomes red.
You can create a new conditional formatting rule and use the "Use a formula to determine which cells to format" option. You can use the formula:
=CountA($A$1:$A$2)=2
When we use a formula to toggle conditional formatting, the formula has to return a TRUE or FALSE which is why we check if the result of this CountA formula returns 2. If both cells A1 and A2 have any value then CountA() will return 2 and the result will be TRUE
The user enters a date/time into cell B2. If this matches one of the values in column L I would like to format cell B2 as red, else format cell B2 as green.
Any idea how to do this?
Please format B2 green with standard fill, then apply the following Use a formula to determine which cells to format, Format values where this formula is true:
=match(B2,L:L,0)>0
with formatting (red) to suit and Applies to B2.
Assuming you are using Excel 2007 onwards:
Set cell shading for B2 = Green
Select Cell B2 and select the Conditional Formatting > New Rule menu item
Use a formula to determine which cells to format
In the formula bar, put in =ISNUMBER(MATCH(B2,$L$6:$L$100,0))
For format, change shading to Red
Obviously change the $L$6:$L$100 to suit you, but that should do it...
What about breaking this up into two steps.
Try putting a simple formula in Cell B1:
=ISNUMBER(MATCH(B2, L:L, 0))
This will return a TRUE if there's a match and a FALSE if there is not a match. Then make two conditional rules based on Cell B1.
Column A has a number 1-10. Column B has a string I want to highlight with conditional formatting. How do I make it so that if the number in Column A is greater than 7, the cell in the same row in Column B will automatically turn blue?
I use the conditional formatting tool for cell B1 such that, in the "Use a formula to determine which cells to format" option, I have ="IF($A1 > 7)", then fill the cell with blue.
But, as I drag/autofill down, the 1 in $A1 does not become A2, A3, A4, A5, A6, etc. as I want it to. What am I doing wrong?
Change the formula to:
=$A1 > 7
And take a look at my yoursumbuddy post, which explains why you don't need IFs in Conditional Formatting:
Select B1, then column B (This should make all the cells bluish except the cell B1, which is said to be the 'active' cell).
Open up conditional formatting and use the formula:
=IF($A1 > 7, 1)
You need to at least specify the value if true and there's no need to drag the conditional formatting down.