Can't Enter Years in a Cell

Written by Allen Wyatt (last updated May 1, 2021)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365


Laurie has a column that she formatted using "yyyy" as a custom format. (She wants it to contain years.) However, when she starts typing years into the column, she doesn't get what she expect. For instance, when she enters 2020 Excel converts the number to 1909. Laurie wonders why this is happening.

It is happening because of the expectations that you set for Excel. When you formatted the column using the "yyyy" custom format, you informed Excel that you wanted whatever was in the column to be considered a date. Yet, you didn't enter a date into the cells—you entered a simple numeric value of 2020. A date would be something such as 1/1/2020 or 1/1/20; these would display the year just fine because they are dates, as Excel expects.

So why does entering just 2020 cause 1909 to be displayed? Because Excel, in trying to make sense of the entry as a date, assumes you are entering a number of days. Internally, dates are stored as a serial number that indicates the number of days since 1/1/1900, with 1 representing 1/1/1900, 2 representing 1/2/1900, 3 representing 1/3/1900, and so on.

It just so happens that the number 2020 represents the date 7/13/1909 (July 13, 1909), which your formatting says should be displayed as simply 1909—the year portion of that valid date. In fact, you can see that date if you select the cell again after trying to enter 2020. Up in the formula bar you'll see how Excel converted your entry into a valid date.

The solution depends on what you want to do with the information in the column. If you simply want to enter a bunch of years, don't format the column as dates. The General format or some other numeric format will work just fine. If, instead, you want actual dates, then you'll need to enter them as such: 1/1/2020, etc.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (10161) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365.

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

Redoing an Object Browse

The Object Browser is a great way to search for and navigate through all sorts of objects in your document. Once you use ...

Discover More

Automatically Adding Captions

Word can automatically add captions to various elements of your document, such as tables or figures. Here's how to ...

Discover More

Sudden Increases in Workbook File Size

Workbooks can get rather large rather quickly. If you think your workbook has gotten too big too fast, here are some ...

Discover More

Professional Development Guidance! Four world-class developers offer start-to-finish guidance for building powerful, robust, and secure applications with Excel. The authors show how to consistently make the right design decisions and make the most of Excel's powerful features. Check out Professional Excel Development today!

More ExcelTips (ribbon)

Moving Cells Using the Mouse

Want to easily move information from one cell to another? A quick way to do it is to simply drag and drop using the mouse.

Discover More

Canceling an Edit

When editing a cell, you may want to cancel the edit at some point. There are two ways to do this, both described in this ...

Discover More

Quickly Filling a Column

Excel has a great (and little known) shortcut for filling a column with information. It comes in very handy when you need ...

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}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. 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 2 + 8?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)


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.