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.
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.

Peter_SSs

MrExcel MVP, Moderator
Joined
May 28, 2005
Messages
48,576
Office Version
  1. 365
Platform
  1. 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,394
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2013
Platform
  1. Windows

ADVERTISEMENT

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,394
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2013
Platform
  1. Windows

ADVERTISEMENT

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,350
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
48,576
Office Version
  1. 365
Platform
  1. 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,130,193
Messages
5,640,771
Members
417,166
Latest member
Funwayo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top