How to do conditional formatting on individual rows in same column? - excel

I want to do conditional formatting on the following data.
Data Image
When first column (1c) value is equal to second(2c). Paint green else paint red.
Compare:
1r1c to 1r2c
2r1c to 2r2c
3r1c to 3r2c
Currently it is comparing r1c1, r2c1 and r3c1 to r1c2.

What's your current conditional formatting rule?
edit:
OK, your current rules are =$E$2 and <>$E$2, both applies to =$D$2
You are telling MS Excel to compare cell D2 with cell E2. First you have to apply your rules over area D2:D_many (you can apply rule over both columns to get both cells colored, sometimes it's useful). Second remove $ in your rules, change rules to =E2 or =$E2 If you apply conditional formatting rule over one column (D), there will be no difference, but if you apply rule over multiple columns (for example D:H), first one will compare cell with cell in the same row but one column right, second one will compare cell with cell in the same row and column E.

Ok.
I tried to create a new rule and got the correct format. I used this formula.
And the rule created was this
Now working fine. Thanks.

Related

Conditional formatting cells based on adjacent cell

I am trying to show that a cell must be filled in. I want to use conditional formatting to highlight the cell isn't filled out using conditional formatting. Based on an EMPTY spreadsheet (gets filled in weekly by row, so I don't want a bunch of red cells until a line is filled in). I want a cell in column I to turn red when either columns "B:H" have text. Then if the person fills out a cell in column I the coloring goes away. I have tried =AND(ISTEXT(B#),ISNONTEXT(I#)), but this means that when a different row in column B is filled out the conditional formatting doesn't work. I then tried to individually put the condition formatting in, but it only works on the first 2 rows. I also tried =AND(ISTEXT($B#),ISNONTEXT($I#)) to show that it is based on the column, that also didn't work. Any help would be greatly appreciated.
Assuming B:H are empty. You can use an AND formula looking at COUNTA (of B:H) combined with ISBLANK (column I).
Select range I2:I4 and input this formula into your Conditional Format Rule:
=AND(COUNTA(B2:H2)>=1,ISBLANK(I2))
Then change your conditional format fill as RED.
Output:

How to compare two different column and highlight highest value in each row?

I am aware of using MAX for conditional formatting however I am confused about how to compare two different columns. I would like to use conditional formatting to compare data/value from columns B and Columns E, then highlight the highest value in each row based on these two columns. I wonder if this is possible?
It does not seem working for this:
enter image description here
You can use conditional formatting to achieve this:
Select the entire range (for example, B1:E10)
Add a new conditional formatting rule.
Home >> Conditional Formatting >> New Rule >> Use a formula to determine which cells to format:
=($E1>$B1)
=($B1>$E1)
Just make sure you type the Formula rather than selecting the cell, or you will have the $ symbol in the reference, which you don't want in the row reference.
So highlight the largest value in each row? That is possible using conditional formatting.
For example, if your entire data frame is in A2:B11, first do =B2>A2 then =A2>B2.
The steps for conditional formatting are below:
highlight the full column of cells you wish to format (in this case, say A2:A11)
Home->Conditional Formatting->New Rule->"Use formula..."
Enter the above formula (being sure to unfreeze column and row references)
Format->Fill->Select Color->Okay->Okay

How to conditional format a range of cells without creating a rule for each?

I have a column of values that i want to conditional format if it is a text and not equal to "---". My question is how would i apply just one rule to each of the column cells without the rule referencing back to where the rule applies D360?
Here's my formula for conditional format:
=AND(ISTEXT($D$360),$D$360<>"---") 'formats to red text
If i put this formula as a rule for each D360:D390, if my D360 is text, the whole range D360:D390 will be red, i only want the cell the rule is on to turn red.
Highlight your cells that you want formatting, add the formula for the first row but make sure you remove the absolute cell references:
Remove the $ sign from the row number of the test.

(Excel) Conditional Formatting based on Adjacent Cell Value

I'm trying to apply conditional formatting in Excel on a range of cells, based on the adjacent cell's value, to achieve something like this:
The goal is to highlight values in Column B (Actual Expense) red if the value is greater than it's adjacent value in column C (Expected Expense). I've followed a number of tutorials that said to apply conditional formatting by selecting Conditional Formatting>New Rules>Use a Formula to Determine Which Cells to Format then applying a rule =$B4>$C4 which would format the 'Actual' cell red if it were greater than the 'Expected' cell. This works great for one cell, but not so well when I attempt to apply this to a range of cells. I've used the format painter as well as editing the rule to be applied over a range of cells (i.e. $B$2:$B$5) as shown below but it only bases the formatting on the initial formula (if B4 is greater than C4) and everything undesirably turns red.
I'd rather not make individual rules for every row. Is there a way to consolidate this into one rule?
You need to take out the $ signs before the row numbers in the formula....and the row number used in the formula should correspond to the first row of data, so if you are applying this to the ("applies to") range $B$2:$B$5 it must be this formula
=$B2>$C2
by using that "relative" version rather than your "absolute" one Excel (implicitly) adjusts the formula for each row in the range, as if you were copying the formula down
I don't know if maybe it's a difference in Excel version but this question is 6 years old and the accepted answer didn't help me so this is what I figured out:
Under Conditional Formatting > Manage Rules:
Make a new rule with "Use a formula to determine which cells to format"
Make your rule, but put a dollar sign only in front of the letter: $A2<$B2
Under "Applies to", Manually select the second column (It would not work for me if I changed the value in the box, it just kept snapping back to what was already there), so it looks like $B$2:$B$100 (assuming you have 100 rows)
This worked for me in Excel 2016.

highlight entire row using conditional format

I reviewed below answer. it's really working for me when i used david's answer. But i have slight different question.
I want to highlight A1,B1,C1,D1 and E1 when condition is true for A1. As per the below answer it highlighting only values in column A
Compare Two columns
Regards,
Ramana
Assuming you should highlight columns A:E in case A1 has "abc" value, you should do the following:
Select the desired range of cells (or perhaps entire columns A:E).
Add Conditional Formatting rule based on a formula, enter the following code: =IF($A1="abc",1,0)=1
Select desired highlight and apply rule.
You're done. The above code will highlight ANY row for A:E columns in case corresponding cell in A has "abc". Modify condition as you wish.
Sample file: https://www.dropbox.com/s/eyx2un2v5r5z25w/CondFormatA-E.xlsx
If you are using this formula for column A
=NOT(ISNA(VLOOKUP(A1,$B:$B,1,FALSE)))
then just amend it by putting $ in front of A1, i.e.
=NOT(ISNA(VLOOKUP($A1,$B:$B,1,FALSE)))
and apply that conditional format to all 5 columns A to E
Note: it might be simpler to use MATCH - this should give the same result
=MATCH($A1,$B:$B,0)

Resources