Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 219
Default Validate same month and same year

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?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 913
Default Validate same month and same year

On Mon, 13 Jul 2009 08:53:09 -0600, salgud
wrote:

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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 219
Default Validate same month and same year

On Mon, 13 Jul 2009 14:54:58 GMT, Lars-Åke Aspelin wrote:

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


Thanks Lars!
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
count month when date is in day/month/year format ccKennedy Excel Worksheet Functions 6 April 30th 09 03:32 AM
Tell me which "season" (Month/Day through Month/Day) a date(Month/Day/Year) falls in (any year)??? misscrf Excel Discussion (Misc queries) 1 December 14th 07 02:59 PM
Sort month/date/year data using month and date only SMW820 Excel Discussion (Misc queries) 6 June 22nd 06 05:14 PM
trying to get day/month/year froamt while user enters year only RADIOOZ New Users to Excel 3 June 7th 06 05:30 AM
Formula to return last day of month for each month in year? StargateFan[_3_] Excel Programming 5 January 3rd 06 04:05 AM


All times are GMT +1. The time now is 05:03 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"