Given a date, how do I get the 1st date and the last date of theprevious month?

A

Author

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.
 
S

Sheeloo

=DATE(YEAR(A3),MONTH(A3),0)
for last day of pervious month

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

for the first day of previous month...

If you want in text format then put TEXT around it with desired format...
 
T

T. Valko

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)
 
R

Ron Rosenfeld

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.

Some date in A1.

First date of previous month:

=A1-DAY(A1)-DAY(A1-DAY(A1))+1

or

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

Last Date of previous month:

=A1-DAY(A1)

--ron
 

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

Similar Threads


Top