formula for last day of month with a twist

  • Thread starter Thread starter MelB
  • Start date Start date
M

MelB

I need a formula that calculates the last day of the month, but if the date
falls on the last day of the month I need it to return the last day of the
next month.

If A1=5/1/07, i need 5/31/07
If A1=5/31/07, i need 6/30/07

Many thanks.
 
=EOMONTH(A1,IF(EOMONTH(A1,0)=A1,1,0))

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

|I need a formula that calculates the last day of the month, but if the date
| falls on the last day of the month I need it to return the last day of the
| next month.
|
| If A1=5/1/07, i need 5/31/07
| If A1=5/31/07, i need 6/30/07
|
| Many thanks.
|
|
 
I need a formula that calculates the last day of the month, but if the date
falls on the last day of the month I need it to return the last day of the
next month.

If A1=5/1/07, i need 5/31/07
If A1=5/31/07, i need 6/30/07

Many thanks.

And, without the Analysis Tool Pak installed:

=A1+33-DAY(A1+1)-DAY(A1+33-DAY(A1+1))
--ron
 
Back
Top