Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default compare month and year in a date

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
--
Afia
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default compare month and year in a date

On Fri, 7 Aug 2009 04:25:01 -0700, Afia wrote:

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
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default compare month and year in a date

Another:

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



Afia wrote:

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
--
Afia


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default compare month and year in a date

Ron, Dave
Thank you!!!
--
Afia


"Dave Peterson" wrote:

Another:

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



Afia wrote:

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
--
Afia


--

Dave Peterson

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 03:59 PM
bar chart to compare month and year data whowhat Charts and Charting in Excel 0 August 22nd 07 08:30 PM
How to compare a date with financial year TUNGANA KURMA RAJU Excel Discussion (Misc queries) 3 March 31st 07 12:08 PM
Sort month/date/year data using month and date only SMW820 Excel Discussion (Misc queries) 6 June 22nd 06 05:14 PM


All times are GMT +1. The time now is 07:02 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"