#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 470
Default DATE question

I was given a formula for one of my questions a while back and I am trying to
understand what it is doing. Below is the formula:

=DATE(YEAR(A42),MONTH(A42)+1,0)

If A42 = 1/15/09, then the above formula returns 1/31/09. My two questions
a

1) Why doesn't MONTH(A42)+1 change the month to Feb?
2) What purpose does 0 in the day spot of DATE serve?

Thanks,
Les
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default DATE question

They are really the same question!

=DATE(YEAR(A42),MONTH(A42)+1,1) will display the date of the first day in
the NEXT month.

=DATE(YEAR(A42),MONTH(A42)+1,0) will display the date of the last day in the
CURRENT month.

You see, the 0 "moves" the date back one day.
--
Gary''s Student - gsnu200828


"WLMPilot" wrote:

I was given a formula for one of my questions a while back and I am trying to
understand what it is doing. Below is the formula:

=DATE(YEAR(A42),MONTH(A42)+1,0)

If A42 = 1/15/09, then the above formula returns 1/31/09. My two questions
a

1) Why doesn't MONTH(A42)+1 change the month to Feb?
2) What purpose does 0 in the day spot of DATE serve?

Thanks,
Les

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7,247
Default DATE question

The 0th day of one month is the last day of the previous month. For
example, if your date is 15-Jan-2009, the MONTH returns 1, so MONTH+1
is 2, and the 0th day of month 2 (February) is the last day of the
previous month (January).


Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)

On Tue, 20 Jan 2009 05:50:31 -0800, WLMPilot
wrote:

I was given a formula for one of my questions a while back and I am trying to
understand what it is doing. Below is the formula:

=DATE(YEAR(A42),MONTH(A42)+1,0)

If A42 = 1/15/09, then the above formula returns 1/31/09. My two questions
a

1) Why doesn't MONTH(A42)+1 change the month to Feb?
2) What purpose does 0 in the day spot of DATE serve?

Thanks,
Les

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
Date Question Gina[_2_] Excel Worksheet Functions 6 July 25th 08 05:51 PM
Date question [email protected] Excel Worksheet Functions 2 September 2nd 06 10:14 PM
Date Question metaltecks Excel Discussion (Misc queries) 5 June 13th 06 02:55 PM
This is a date question... Robert Excel Discussion (Misc queries) 4 August 2nd 05 04:22 PM
Another Date Question Kdub via OfficeKB.com Excel Discussion (Misc queries) 1 June 30th 05 01:09 AM


All times are GMT +1. The time now is 04:10 AM.

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"