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

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
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,636
Messages
6,120,669
Members
448,977
Latest member
moonlight6

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