Link to home
Start Free TrialLog in
Avatar of Euro5
Euro5Flag for United States of America

asked on

excel previous month in yyyymm format

I need a cell that will pull the previous month in this format yyyymm.
For instance, this is July, so I need the cell to populate 201606 (june 2016)
August should be 201607

Also, I need a rolling 12 month also, so if the result is 201607, I need another cell to populate 201508

Can anyone help??
Avatar of Subodh Tiwari (Neeraj)
Subodh Tiwari (Neeraj)
Flag of India image

You may have the following formula in any cell...

=EOMONTH(TODAY(),-1)

Open in new window

and then custom format the formula cell with yyyymm.

Now for another date you may have something like....
=DATE(YEAR(TODAY())-1,MONTH(TODAY())+1,1)

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Rgonzo1971
Rgonzo1971

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Or you may replace the second formula with this....

=EOMONTH(EDATE(A2,-12),2)

Open in new window