Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


Passing date as text in different format in Excel

Posted on 2011-03-23
Medium Priority
Last Modified: 2012-05-11

I need to take todays date and add it to the end of a function as itself in a separate format, then I need to take the date from a month ago, from 6 months ago, and from 12 months ago and do the same thing. This isn't very clear and is best illustrated with an example.

I have a date:

=TODAY()      -> 3/23/2011

I need this date to become a text string in the form of:

CellA1: 20110323

which gets added to some text in a function:


Which should result in my final text becoming "TEXT=20110323"

I then need to do this for a month ago and 6 months ago and a year ago.

Right now I create the date =TODAY() in the format yyyymmdd, but when I add this to the end of my string, it becomes 40625, the converted Microsoft date.

Question by:keats88
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
  • 3
  • 2
  • 2
LVL 81

Accepted Solution

zorvek (Kevin Jones) earned 2000 total points
ID: 35201278
Any date can be formatted as you desire with:


LVL 81

Expert Comment

by:zorvek (Kevin Jones)
ID: 35201337
To find dates so many months in the past use the EDATE function:

EDATE(StartDate, Months) - Returns the date time serial number of the date that is the indicated number of months before or after the parameter StartDate. Requires the Analysis Toolpak.


Author Closing Comment

ID: 35201341
Oh man, that worked. I have no idea why I thought it wouldn't and didn't bother trying it. Thanks
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

LVL 39

Expert Comment

ID: 35201342
And to get to the 3, 6 12 months ago, your best bet is to install the analysis toolpak add-in and use the edate formula. So with Kevin's suggestion


will give you the date 6 months ago, as text in the right format

LVL 81

Expert Comment

by:zorvek (Kevin Jones)
ID: 35201351
So, to do what you want with a date six months in the past:



Author Comment

ID: 35201554
Thanks guys, this other stuff is helpful too, I wish I hadn't already picked the solution so I could give you guys some points. Sorry :-(
LVL 39

Expert Comment

ID: 35201617
Most of the you guys are the one you accepted the solution of, so I guess you're fine.


Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

597 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