Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,814
Default Maximum date in a Month

Is there a way, using a macro to calculate the last date for a month when the
fist day of the month is input?
examples:
Input 10/1/2008
Result 10/31/2008

Input 8/1/2008
Result 8/31/2008

Thanks
Steve
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 342
Default Maximum date in a Month

Assuming your input date is in cell A1, try this formula:


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

tom
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Maximum date in a Month

If you have the Analysis ToolPak add-in installed (Excel versions prior to
Excel 2007):

A1 = some date

=EOMONTH(A1,0)

--
Biff
Microsoft Excel MVP


"Steve" wrote in message
...
Is there a way, using a macro to calculate the last date for a month when
the
fist day of the month is input?
examples:
Input 10/1/2008
Result 10/31/2008

Input 8/1/2008
Result 8/31/2008

Thanks
Steve



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,814
Default Maximum date in a Month

Works fine. Thanks guys
Steve

"T. Valko" wrote:

If you have the Analysis ToolPak add-in installed (Excel versions prior to
Excel 2007):

A1 = some date

=EOMONTH(A1,0)

--
Biff
Microsoft Excel MVP


"Steve" wrote in message
...
Is there a way, using a macro to calculate the last date for a month when
the
fist day of the month is input?
examples:
Input 10/1/2008
Result 10/31/2008

Input 8/1/2008
Result 8/31/2008

Thanks
Steve




  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Maximum date in a Month

You're welcome. Thanks for the feedback!

--
Biff
Microsoft Excel MVP


"Steve" wrote in message
...
Works fine. Thanks guys
Steve

"T. Valko" wrote:

If you have the Analysis ToolPak add-in installed (Excel versions prior
to
Excel 2007):

A1 = some date

=EOMONTH(A1,0)

--
Biff
Microsoft Excel MVP


"Steve" wrote in message
...
Is there a way, using a macro to calculate the last date for a month
when
the
fist day of the month is input?
examples:
Input 10/1/2008
Result 10/31/2008

Input 8/1/2008
Result 8/31/2008

Thanks
Steve






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
Return Maximum value for Specific Month(s) Sam via OfficeKB.com Excel Worksheet Functions 5 December 6th 06 07:42 PM
Date arithmetic: adding 1 month to prior end of month date manxman Excel Worksheet Functions 2 July 14th 06 09:29 PM
Sort month/date/year data using month and date only SMW820 Excel Discussion (Misc queries) 6 June 22nd 06 05:14 PM
=VLOOKUP(1,Nationality!B5:B29,IF(MONTH(date)6,MONTH(date)-6, MON Ali Excel Worksheet Functions 14 January 18th 06 08:20 AM
Month to date sales - reset in new month??? [email protected] Excel Worksheet Functions 2 November 26th 05 08:18 PM


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