Alternate Row color on based on non-blank cell

buzz71023

Active Member
Joined
May 29, 2011
Messages
295
Office Version
  1. 2016
Platform
  1. Windows
I have a spreadsheet that alternates the color of a range (C5:J500) or (=$C$5:$J$500) in conditional formatting selection. This part work great.
The problem is most of these do not always have data.
I would like the color of each row (C-J) to alternate color only if there was data in column C.

So once there is input into C the shading would change (if it's not the white rows turn)

My current Conditional Formatting formula is below.

thanks in advance for any and all input.

Code:
=MOD(ROW(),2)=0
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Maybe...

=AND($C5<>"",MOD(ROWS($C$5:C5),2)=0)
or
=AND($C5<>"",MOD(ROW(),2)=0)

M.
 
Last edited:
Upvote 0
=AND($C5<>"",MOD(ROWS($C$5:C5),2)=0)

Worked perfectly.

Thank you!
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,748
Members
448,989
Latest member
mariah3

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
Back
Top