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

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.
 
P

Pete_UK

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
 
D

DawnTreader

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.
 
P

Pete_UK

Glad to hear it - thanks for feeding back. With MATCH you get the
position number directly.

Pete
 

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

Top