a moth before

J

John

I need to have a cell that shows a moth before today
=today () 'it shows 30-july
i need to have = June
How ca do it?
Thanks
John
 
P

Paul B

John this should do it =DATE(YEAR(TODAY()),MONTH(TODAY())-1,DAY(TODAY()))

--
Paul B
Always backup your data before trying something new
Using Excel 2000 & 97
Please post any response to the newsgroups so others can benefit from it
** remove news from my email address to reply by email **
 
G

Gnasher

I need to have a cell that shows a moth before today
=today () 'it shows 30-july
i need to have = June
How ca do it?
Thanks
John
Neither of the above quite give you what I suspect you want. But putting
the two ideas together seems to work and copes with leap years as well:

=DATE(YEAR(A6),MONTH(A6)-1,MIN(DAY(A6),DAY(EOMONTH(A6,-1))))

Where A6 is the original date cell.

This gives the desired transformation when the previous month is shorter
than the current one:

30-Jul-03 -> 30-Jun-03
31-Jul-03 -> 30-Jun-03

Suck and see.
 

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