![]() |
Calculate date for one month previous?
Cell A1 has 2/1/09 in it. Is there a way cell A2 can calculate the date of
the previous month, 1/1/09? |
Calculate date for one month previous?
=DATE(YEAR(A1),MONTH(A1)-1,DAY(A1))
Just be caareful about going back to a short month. -- Gary''s Student - gsnu200852 "liirogue" wrote: Cell A1 has 2/1/09 in it. Is there a way cell A2 can calculate the date of the previous month, 1/1/09? |
Calculate date for one month previous?
liirogue wrote...
Cell A1 has 2/1/09 in it. *Is there a way cell A2 can calculate the date of the previous month, 1/1/09? Referring to your starting date as SD, the usual way is =DATE(YEAR(SD),MONTH(SD)-1,DAY(SD)) as long as you're willing to live with how Excel handles 1 month previous to, e.g., 3/30/2009 or 5/31/2009. If you want the last day of a month with more days than the preceding month mapping to the last day of the preceding month, you could try =MIN(DATE(YEAR(SD),MONTH(SD)-1,DAY(SD)),SD-DAY(SD)) |
Calculate date for one month previous?
=MIN(DATE(YEAR(A2),MONTH(A2)-{1,0},DAY(A2)*{1,0}))
-- __________________________________ HTH Bob "liirogue" wrote in message ... Cell A1 has 2/1/09 in it. Is there a way cell A2 can calculate the date of the previous month, 1/1/09? |
All times are GMT +1. The time now is 09:15 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com