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 Office 365.
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!
Don't like the way that Excel pastes when you press CTRL+V? Here are some ways that you can modify the normal paste mode ...
Discover MoreUsing the mouse's scroll wheel can help improve how you edit information in a worksheet. Here's how to make sure that the ...
Discover MoreWhen you want to remove information from a worksheet, you can either clear cells or delete cells. This tip examines the ...
Discover MoreFREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
2018-10-23 04:37:15
Peter Atherton
Hank
As stated above dates need to be entered in full. Excel's date system only runs from 1st Jan 1900 or 1st Jan 1904 depending on what options you use. 1/1/x has the serial number 1 and increments by 1 each date and this is how we can find how many day are between two dates. Once the dates are entered you can then format it to show just years and Excel will use the full date in any process.
The only problem is with historical dates prior to the date serial number 1. John walk has an add-in that uses historical dates see http://spreadsheetpage.com/index.php/pupv7/home
Also see https://en.wikipedia.org/wiki/Proleptic_Gregorian_calendar for changes in dates system.
2018-10-22 06:52:20
Michael Avidan
@Jan Doeleman,
Close but not close enough.
TAke a look at the attached picture.
(see Figure 1 below)
--------
Micky
Figure 1.
2018-10-21 15:42:14
Hank Phillips
Hi Allen, Excel is obviously useless. If asked when America was discovered it can only generate bovine incomprehension. When I was in college we had this stuff called math, where you entered years on the horizontal axis and data on the vertical. Programs I used 30 years ago allowed this much like graph paper, and generated graphs the way any bright 9-year old would. I am looking for a product that expects the x-axis to be years. Failing that I want to buy graph paper onscreen where I enter dates on x and numbers on y. In Excel this is asking too much, and Open Office, though better, still copies Excel errors and all. Where can I buy a graphing tool that understands what a year is?
2015-12-08 22:23:03
Kingfish
Try hittig your "num lock" one time.
2015-03-28 22:30:25
Dan Swartz
Just remember that when using relative functions such as =now or =today, etc. that the year will change depending on when anyone uses that file--and each time you will produce different results. You could get in a huge bind if you use a relative function with data you need to always represent a fixed period in time.
2015-03-28 08:45:13
Jan Doeleman
You can use the function =NOW() in a cell. And set the format to yyyy. It displays the precise year.
Example:
In Cel A1 =NOW()
In Cel B1 =NOW()+365
etc. Don't forget the format setting YYYY.
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.
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2021 Sharon Parq Associates, Inc.
Comments