View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
T. Valko T. Valko is offline
external usenet poster
 
Posts: 15,768
Default Given a date, how do I get the 1st date and the last date of the previous month?

For the last day of the previous month:

=A3-DAY(A3)

For the first day of the previous month:

=DATE(YEAR(A3),MONTH(A3)-1,1)

--
Biff
Microsoft Excel MVP


"Author" wrote in message
...
This is very useful in creating an invoice, in which case, you usually
create an invoice for the last month.

So, given today Arpil 1, 2009, how to get March 1, 2009 and March 31,
2009

Suppose I have 04/01/2009 in A3

I have been able to find the first date of March through this in for
example F8.

= TEXT(DATE(YEAR(A3), MONTH(A3)-1, 1), "mm/dd/yyyy")

Now, how do I find the last date of the previous month?

Thank you.