Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, and 2016. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Entering Dates in Excel.

Entering Dates in Excel

by Allen Wyatt
(last updated May 6, 2017)

6

Dates are a special case in Excel. If you enter information that can be translated as a date (by any stretch of the imagination), then Excel treats it as a date. It converts your data into a serial number that is internally used to represent dates and times. For instance, any of the following entries will be translated to a date by Excel:

  • 5/22
  • 5-22/17
  • 22 May
  • May 22, 2017

If you enter the first example, Excel will convert it to a date and display that date as best it can determine. If you leave off the year in your entry, Excel assumes you mean the current year. You could also use dashes instead of slashes and Excel will still figure out you are entering a date.

Regardless of how you type a date, it is converted to a special serial number by Excel and stored internally in that format. How you see the date on your screen is a consequence of how the cell is formatted. Even though Excel stores dates in a standard format internally, they can be displayed using any number of different formats.

Understanding that Excel will always try to convert an entry into a date if it can—by any stretch of the imagination—be considered a date, you may be tempted to ask how you can stop Excel from doing such conversions. There are only two ways I've been able to come up with:

  • Format the cell as Text before entering a value in the cell.
  • Preface your entry with an apostrophe.
  • Preface your entry with an equal sign.

Either of the first two approaches forces Excel to treat your entry as text, not as a date. The third approach treats the entry as an actual formula, such that Excel would convert =5/22 to 0.22727273, which is 5 divided by 22.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (12386) applies to Microsoft Excel 2007, 2010, 2013, and 2016. You can find a version of this tip for the older menu interface of Excel here: Entering Dates in Excel.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He  is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Fitting to a Single Page

It can be frustrating when a single-page document actually prints of two pages, depending on the system that is doing the ...

Discover More

Using Seek In a Macro

When reading information from a text file, your macro may need to start reading at a place other than the beginning of the ...

Discover More

Hiding Columns Not within a Date Range

Want to automatically hide some columns that don't meet a date criteria that you set? You can't do it automatically, but you ...

Discover More

Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!

More ExcelTips (ribbon)

Rounding in Results

Rounding is a fact of life when it comes to using formulas in a worksheet. Sometimes that rounding can be a bit confusing, ...

Discover More

Converting Text to Values

When you import information originating in a different program, Excel may not do the best job at figuring out what various ...

Discover More

Scroll Wheel Doesn't Work when Editing

Using the mouse's scroll wheel can help improve how you edit information in a worksheet. Here's how to make sure that the ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is three more than 8?

2017-05-12 18:36:28

Fred

Barry and Peter, thanks. I'll see if I can get that idea working.

Fred


2017-05-12 05:03:24

Barry

I had a similar problem a year or so ago. The basic problem is that Excel isn't recognising the date as a date.

You can use a helper column with a formula that pulls the downloaded date apart and puts it back together as a date that Excel will recognise. Or as I did I created a macro to do this which I run immediately after I do the download (in fact the macro does the download and converts the dates, on a time schedule automatically).

There are other tips on this site that cover formulas to pull dates apart, and put them back together again.
https://excelribbon.tips.net/T009779_Converting_an_Unsupported_Date_Format.html
https://excelribbon.tips.net/T011400_Entering_Dates_without_Separators.html

You'll have to modify the formulas/macros to suit the particular format of your dates.


2017-05-12 03:41:39

peter b

Fred,

Have you thought about using helper cells to process the ""Monday, January 1, 2017" dates?
e.g. the extract the year using right(4)... extract the day of month using mid and finding the 2nd comma.. and use vlookup for converting the text of the month into a number.. and then recombine them all using the date() function.

Peter


2017-05-11 13:23:44

Fred

Peter,
Thanks, but I can't change the format of the data before downloading it (it comes from another company that has little interest in helping its customers... but that's another story).

I'm not sure what you mean by preformatting. I use a web interface to download their data as an Excel file.

And finally, applying the formatting -- any type of date format --to those dates just doesn't work. Which is why I have to go through and manually change Every. Single. Date.


2017-05-11 12:00:28

Peter Atherton

Fred

I don't know about downloading from database but you could try preformatting using the following
dddd, mmmm d, yyyy

If that fails sellect all the dates and apply that formatting.


2017-05-10 11:05:22

Fred

Allen,

I have to download data from a database that has dates written like this: "Monday, January 1, 2017". Even if I tell Excel (2013 and/or 2016) that this column is dates, and even if I tell Excel to format that column of dates exactly the same way (which is indeed one of the pull-down options for formatting dates) Excel still won't recognize those cells as dates. Thus, I have to go through every export and manually reenter all the dates so that Excel will recognize them.

Do you have any ideas how avoid this?

Thanks,
Fred


This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.