Maximum date in a Month

S

Steve

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

TomPl

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


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

tom
 
T

T. Valko

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

A1 = some date

=EOMONTH(A1,0)
 
S

Steve

Works fine. Thanks guys
Steve

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

A1 = some date

=EOMONTH(A1,0)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top