Validate same month and same year

  • Thread starter Thread starter salgud
  • Start date Start date
S

salgud

Got help here figuring out the formula to validate that 2 dates in another
cell (not the one with the validation formula) were for the same month. I
now need to validate they are both the same month and year.
I've tried:
=MONTH(H7)=MONTH(I7)and=year(H7)=year(I7)
which XL doesn't accept. I tried
=(MONTH(H7)=MONTH(I7))and(year(H7)=year(I7))
but that doesn't work either.
Any suggestions?
 
Got help here figuring out the formula to validate that 2 dates in another
cell (not the one with the validation formula) were for the same month. I
now need to validate they are both the same month and year.
I've tried:
=MONTH(H7)=MONTH(I7)and=year(H7)=year(I7)
which XL doesn't accept. I tried
=(MONTH(H7)=MONTH(I7))and(year(H7)=year(I7))
but that doesn't work either.
Any suggestions?


Try this formula:

=AND(MONTH(H7)=MONTH(I7),YEAR(H7)=YEAR(I7))

Hope this helps / Lars-Åke
 
Back
Top