compare month and year in a 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
 
R

Ron Rosenfeld

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
 
D

Dave Peterson

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
 

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