Conditional formatting two rows at a time

  • Thread starter Thread starter Mike K
  • Start date Start date
M

Mike K

Given a data set of the following:

City, Some number
Atlanta, 4
Altanta, 7
Dallas, 3
Dallas, 1
Toronto, 8
Toronto, 10
Trenton, 12
Trenton, 1

Can I do conditional formatting so that each set of two rows has
alternating colors? For example, the two rows with Atlanta are
highlighted yellow, Dallas white, Toronto yellow, Trenton white.
 
Maybe use format|conditional formatting.

Select your range A2:Bxxx (headers in row 1??)

Then with A2 the activecell
format|conditional formatting
formula is:
=MOD(ROW(A2),4)<2
And give it a nice yellow pattern.
 
If A2 is the active cell for
=MOD(ROW(A2),4)<2
you could simply code as
=MOD(ROW(),4)<2
for exactly the same meaning and effect.
 
You are correct, sir!

David said:
If A2 is the active cell for
=MOD(ROW(A2),4)<2
you could simply code as
=MOD(ROW(),4)<2
for exactly the same meaning and effect.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top