View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave F Dave F is offline
external usenet poster
 
Posts: 2,574
Default How do I apply conditional formatting to even or odd numbers?

Well XL doesn't consider numbers formatted in that manner to be numbers but
rather strings of text.

How do you consider one of these "numbers" to be even or odd? On the basis
of the last digit? The first digit?

If it's the last then you would do something like
=OR(Right(A1="1",1),...RIGHT(A1="9",1))))

Fill in the ... with 3, 5, and 7

If your determination of odd or even depends on the first character, then
replace RIGHT with LEFT in the above function.

Dave
--
Brevity is the soul of wit.


"pashearer" wrote:

I'm trying to change the color of various cells that have the following
string 8056201-001, 8056202-001, 8056203-001, etc. I'd like change the even
numbers to blue text and the odd numbers to green.