ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   formula using dates (https://www.excelbanter.com/excel-discussion-misc-queries/165355-formula-using-dates.html)

MelB

formula using dates
 
I need a formula that does the following:

If A1 is between(and including) 1/1/08 and 1/31/08 I need 12/31/07 returned.
I need that done for each of the 12 months, ie if A1 is between (and
including) 2/1/08 and 2/28/08 I need 1/31/08 returned.

Dave Peterson

formula using dates
 
=a1-day(a1)
and
=date(year(a1),month(a1),0)

Will both return the last day of the previous month

MelB wrote:

I need a formula that does the following:

If A1 is between(and including) 1/1/08 and 1/31/08 I need 12/31/07 returned.
I need that done for each of the 12 months, ie if A1 is between (and
including) 2/1/08 and 2/28/08 I need 1/31/08 returned.


--

Dave Peterson

Damon Longworth

formula using dates
 
=A1-DAY(A1)

--

Damon Longworth

2007 Excel / Access User Conference

Cambridge, England - Nov 29 - Dec 1, 2007


2008 Excel / Access User Conference

Sydney, Australia - Tentatively March 12-14, 2008
www.ExcelUserConference.com/



"MelB" wrote in message
...
I need a formula that does the following:

If A1 is between(and including) 1/1/08 and 1/31/08 I need 12/31/07 returned.
I need that done for each of the 12 months, ie if A1 is between (and
including) 2/1/08 and 2/28/08 I need 1/31/08 returned.



Gary''s Student

formula using dates
 
=DATE(YEAR(A1),MONTH(A1),0)

--
Gary''s Student - gsnu200755


All times are GMT +1. The time now is 10:21 AM.

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