Solved

excel previous month in yyyymm format

Posted on 2016-07-20
3
132 Views
Last Modified: 2016-07-20
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??
0
Comment
Question by:Euro5
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 31

Expert Comment

by:Subodh Tiwari (Neeraj)
ID: 41721439
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

1
 
LVL 51

Accepted Solution

by:
Rgonzo1971 earned 500 total points
ID: 41721440
Hi,

you could try ( with the right format "yyyymm" )
=DATE(YEAR(TODAY()),MONTH(TODAY()),0)
=DATE(YEAR(TODAY()),MONTH(TODAY())-10,0)

Open in new window

Regards
EE20160720.xlsx
0
 
LVL 31

Expert Comment

by:Subodh Tiwari (Neeraj)
ID: 41721441
Or you may replace the second formula with this....

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

Open in new window

0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question