ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Maximum date in a Month (https://www.excelbanter.com/excel-discussion-misc-queries/209116-maximum-date-month.html)

Steve

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

TomPl

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


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

tom

T. Valko

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




Steve

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





T. Valko

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








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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com