ingnoring day in date frmat

M

mostakimm

hi all

i am trying to use the conditional formating by comparing two cells,
both are date formated but one is *may-1-06* and the othe is
*may-9-06*, i would like to compare only the month and year, it sould
not matter what day of the month, so the above date should match in my
conditional formation.

mybe there is a way to change all the -days- in all the dates to be
the same, like the first of the month.

any idea, VB solution:rolleyes: .

thank you all.
marwan
 
S

Steve Yandl

If you have a date in A1,
=DATE(YEAR(A1),MONTH(A1),1)
should return the date for the first of the month for the month and year the
date in A1 represents.

Steve
 
D

Dave Peterson

Maybe you can use something like:

=TEXT(A1,"yyyymm")=TEXT(B1,"yyyymm")

in your conditional formatting formula.
 
I

intruder9

If you use this it will give you the number of months between the 2
dates and you could use this number foir conditional formating
=DATEDIF(A1,B1,"ym")
 
Top