Conditional formatting of block of data

excel-rob

Board Regular
Joined
Feb 24, 2009
Messages
58
Hi,

I'm trying to format each row in a block of data based on the entries in one column. So for example, in row 2, if cell E2 contains the words "complete" or "N/A", I want the text in all the columns in row 2 to be grey. Then the same with row 3, but with reference to E3, and so on.

Conditional highlighting seems the obvious choice, so I highlighted A2:E1000 and then put this formula into conditional highlighting:

=IF(OR(E2="complete",E2="N/A"),1,0)

and chose font colour grey.

This works, but only applies the formatting to column A. How do I get it to apply it to all the columns that I highlighted?

Thanks in advance for any help.
 

Some videos you may like

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand

Peter_SSs

MrExcel MVP, Moderator
Joined
May 28, 2005
Messages
43,700
Office Version
365
Platform
Windows
You shouldn't need the IF part of the formula and you do need an absolute reference to column E, hence the $ signs. Try

=OR($E2="complete",$E2="N/A")
 

excel-rob

Board Regular
Joined
Feb 24, 2009
Messages
58
Thanks, that works great. Of course I didn't need the OR, it already gives a binary response :oops:

Why do you need the $ on the tested column out of interest?

Thanks.
 

bobsan42

Well-known Member
Joined
Jul 14, 2010
Messages
1,343
Thanks, that works great. Of course I didn't need the OR, it already gives a binary response :oops:

Why do you need the $ on the tested column out of interest?

Thanks.
the $E2 tells excel to keep looking in column E even if you move the formula left and right.
for example if you put a reference to E2 in column A and then copy it to B it will change the ref. to F2
i don't know if i succeded to explain it :rolleyes:
 

excel-rob

Board Regular
Joined
Feb 24, 2009
Messages
58
Sorry, didn't explain myself very clearly. I know what the $ does in the normal way you just describe. I just don't understand when it changes the behaviour of conditional highlighting in the way described above...
 

bobsan42

Well-known Member
Joined
Jul 14, 2010
Messages
1,343
Sorry, didn't explain myself very clearly. I know what the $ does in the normal way you just describe. I just don't understand when it changes the behaviour of conditional highlighting in the way described above...
it does not change the formatting - it only fixes the location of the condition
 

Special-K99

Well-known Member
Joined
Nov 7, 2006
Messages
8,341
Works exactly the same way.

"...I'm trying to format each row in a block of data based on the entries in one column..."

So regardless of the column of the cell in the row you are formatting
every cell in that row needs to be based on that one column
 

Peter_SSs

MrExcel MVP, Moderator
Joined
May 28, 2005
Messages
43,700
Office Version
365
Platform
Windows
Of course I didn't need the OR, it already gives a binary response
You DO need the OR if you are testing for either "complete" or "N/A". What you didn't need was the IF function.
 

Watch MrExcel Video

Forum statistics

Threads
1,090,306
Messages
5,413,684
Members
403,496
Latest member
chamshop

This Week's Hot Topics

Top