Conditional Formating =mod($a2,2) = not(mod($a2,2))

  • Thread starter Thread starter DawnTreader
  • Start date Start date
D

DawnTreader

i have a quick question

when using this set of formulas in the conditional formatting does it work
on text?

i am trying to alternately highlighting groups of months. for example i have
the month name january in multiple rows, followed by february and so on. i
want each group to hightlight according to the conditional formatting.
 
You need to convert those month names into numbers, and one way is to
list the twelve months somewhere, eg N1:N12. Then with A2 selected,
click on Format | Conditional Formatting, and in the CF dialogue box
you can choose Formula Is rather than Cell Value Is and for the
formula enter this:

=AND($A2<>"",MOD(MATCH($A2,$N$1:$N$12,0),2)=1)

then click the Format button and choose your format, eg Patterns tab
(for background colour) and choose Pink, then OK your way out. Use the
Format Painter icon to apply the CF to other cells.

Odd-numbered months, i.e. January, March, May etc will appear shaded.

Hope this helps.

Pete
 
Thats what i figured.

i created a vlookup to look at a table to find the number of the month and
then used the formulas on that column and it all worked out.
 
Glad to hear it - thanks for feeding back. With MATCH you get the
position number directly.

Pete
 
Back
Top