Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I need a formula that will return the last day of the month for a period of
two months prior to the date I enter. For example, if I enter 1/1/08 in Cell A1, I want Cell B1 to return 11/30/07; if I enter 2/1/08 in Cell A1, I want Cell B1 to return 12/31/07, etc.. P.S. Cell A1 will always be the first day of the month (if that matters) Thanks |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Since the 0th day of one month is the last day of the prior month,
=DATE(YEAR(A1),MONTH(A1)-1,0) (the 0th day of last month). Or, if A1 is always the 1st of the month, you could also use =A1-DAY(A1-1)-1 (subtract from A1 the number of days in the prior month, plus 1) "user@msn" wrote: I need a formula that will return the last day of the month for a period of two months prior to the date I enter. For example, if I enter 1/1/08 in Cell A1, I want Cell B1 to return 11/30/07; if I enter 2/1/08 in Cell A1, I want Cell B1 to return 12/31/07, etc.. P.S. Cell A1 will always be the first day of the month (if that matters) Thanks |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
On Wed, 12 Dec 2007 10:41:04 -0800, user@msn
wrote: I need a formula that will return the last day of the month for a period of two months prior to the date I enter. For example, if I enter 1/1/08 in Cell A1, I want Cell B1 to return 11/30/07; if I enter 2/1/08 in Cell A1, I want Cell B1 to return 12/31/07, etc.. P.S. Cell A1 will always be the first day of the month (if that matters) Thanks =A1-DAY(A1)-DAY(A1-DAY(A1)) and it doesn't matter what day of the month is in A1. --ron |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Date Calculation | Excel Worksheet Functions | |||
Tricky Date calculation: How to calculate a future date | Excel Discussion (Misc queries) | |||
Date Calculation | Excel Discussion (Misc queries) | |||
Date calculation | New Users to Excel | |||
Date calculation | Excel Worksheet Functions |