Calculate date for one month previous?

L

liirogue

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?
 
G

Gary''s Student

=DATE(YEAR(A1),MONTH(A1)-1,DAY(A1))

Just be caareful about going back to a short month.
 
H

Harlan Grove

liirogue said:
Cell A1 has 2/1/09 in it.  Is there a way cell A2 can calculate the dateof
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))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top