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.
Save Time and Supercharge Excel! Automate virtually any routine task and save yourself hours, days, maybe even weeks. Then, learn how to make Excel do things you thought were simply impossible! Mastering advanced Excel macros has never been easier. Check out Excel 2010 VBA and Macros today!
Need to limit the number of characters that can be entered into a cell? One easy way to do it is through the use of Data ...Discover More
At the very heart of editing is the ability to move and copy cells in a worksheet. Understanding the differences between ...Discover More
To reduce the chances of confusion in presenting data, some people like to use zeroes with slashes through them. If you ...Discover More
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
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.