Can't Enter Years in a Cell

by Allen Wyatt
(last updated March 28, 2015)

3

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 enter 2014 Excel converts the number to 1905. 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 2014. A date would be something such as 1/1/2014 or 1/1/14; these would display the year just fine because they are dates, as Excel expects.

So why does entering just 2014 cause 1905 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 2014 represents the date 7/6/1905 (July 6, 1905), which your formatting says should be displayed as simply 1905—the year portion of that valid date. In fact, you can see that date if you select the cell again after trying to enter 2014. 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/2014, etc.

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

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

Symbols for Non-Printing Characters

Displaying non-printing characters can help you better understand the formatting and contents of your documents. What do all ...

Discover More

Stopping the Deletion of Cells

You can delete cells from a worksheet, and Excel will move the remaining cells either to the left or upwards. Deletions, ...

Discover More

Limiting Lines in a Table Cell

When creating tables, Word automatically sets the size of the cells. But what if you want to make sure each cell is a certain ...

Discover More

Comprehensive VBA Guide Visual Basic for Applications (VBA) is the language used for writing macros in all Office programs. This complete guide shows both professionals and novices how to master VBA in order to customize the entire Office suite for their needs. Check out Mastering VBA for Office 2010 today!

MORE EXCELTIPS (RIBBON)

Using the Fill Handle from the Keyboard

The fill handle can save a huge amount of time when you are editing a worksheet. If you are really good at using the keyboard ...

Discover More

Copying Between Instances of Excel

Copying information between two instances of Excel is different than copying information between two worksheets opened in a ...

Discover More

Converting Forced Text to Numbers

If you have some numbers stored in cells that are formatted as text, you may get some surprises when you try to use those ...

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 for this tip:

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 7 + 8?

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.


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.

Links and Sharing
Share