compare month and year in a date

  • Thread starter Thread starter Afia
  • Start date Start date
A

Afia

I have 2 date columns and i need to compare the month and year only,

for example: column a = 31/12/2009 and column 2 is 12/12/2009, the result
should be true
 
I have 2 date columns and i need to compare the month and year only,

for example: column a = 31/12/2009 and column 2 is 12/12/2009, the result
should be true

=and(month(a1)=month(b1),year(a1)=year(b1))

or, less intuitive but shorter:

=(a1-day(a1))=(b1-day(b1))



--ron
 
Another:

=text(a1,"yyyymm")=text(b1,"yyyymm")


I have 2 date columns and i need to compare the month and year only,

for example: column a = 31/12/2009 and column 2 is 12/12/2009, the result
should be true
 
Back
Top