ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   formula for last day of month with a twist (https://www.excelbanter.com/excel-discussion-misc-queries/168104-formula-last-day-month-twist.html)

MelB

formula for last day of month with a twist
 
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.



Niek Otten

formula for last day of month with a twist
 
=EOMONTH(A1,IF(EOMONTH(A1,0)=A1,1,0))

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"MelB" wrote in message ...
|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.
|
|



pinmaster

formula for last day of month with a twist
 
Hi,

Try this:

=IF(A1=EOMONTH(A1,0),EOMONTH(A1,1),EOMONTH(A1,0))

Regards!
Jean-Guy

"MelB" wrote:

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.



Teethless mama

formula for last day of month with a twist
 
Try this:

=EOMONTH(A1+1,0)


"MelB" wrote:

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.



pinmaster

formula for last day of month with a twist
 
Perfect!!

Cheers!
Jean-Guy

"Teethless mama" wrote:

Try this:

=EOMONTH(A1+1,0)


"MelB" wrote:

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.



Ron Rosenfeld

formula for last day of month with a twist
 
On Sat, 1 Dec 2007 08:10:01 -0800, MelB wrote:

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


All times are GMT +1. The time now is 03:17 AM.

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