a moth before

  • Thread starter Thread starter John
  • Start date Start date
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
 
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 **
 
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.
 
Back
Top