Sub topic 1
Dates are numbers: the serial number model
Excel does not store a date as text or as a calendar object. It stores a plain number, called a serial number, and the cell's format decides whether you see that number or a readable date. Every date function in this tutorial rests on this idea.
Prerequisites
This chapter assumes you can do three things:
- Enter and edit a formula in a cell.
- Refer to other cells, such as
A2. - Apply a number format to a cell, for example from the Number Format box on the Home tab.
The model
A serial number is a count of days. In the default 1900 date system, serial 1 is 1 January 1900, serial 2 is 2 January 1900, and so on. Each day adds exactly 1. For example:
| Date | Serial number |
|---|---|
| 1 January 1900 | 1 |
| 1 January 2023 | 44927 |
| 15 March 2023 | 45000 |
| 1 January 2024 | 45292 |
Because a date is a number, you can compare, sort, add, and subtract dates with the same operators you use on any other numbers. A later date always has a larger serial number.
Seeing the serial number
The stored value and the displayed text are separate. Enter this formula in a cell:
=DATE(2023,3,15)Excel usually formats the result as a date automatically, so you see something like 15/03/2023. Now select the cell and change its format to General. The cell shows 45000. The value did not change. Only the display did.
To inspect any date this way:
- Select the cell.
- Open the Number Format box on the Home tab.
- Choose General (or Number).
- Switch back to a date format when you are done.
The formula bar is a useful check. If a cell looks like a date but the formula bar shows the same text you typed, such as 2023-03-15, you may have a text date. The last section of this tutorial covers that case.
Time of day is a fraction
A whole number identifies the day. Any time of day is stored as a fraction after the decimal point. Noon is half a day, so 15 March 2023 at 12:00 is 45000.5. Midnight is .0, and 6:00 is .25. Chapter content on this appears later. For now, remember that a cell showing 45000.75 holds both a date and a time.
The 1900 date system and its limits
Excel's default 1900 system starts counting at 1 January 1900, so earlier dates cannot be stored as real dates. Excel also has a known quirk: it treats 1900 as a leap year, which makes serial 60 a 29 February 1900 that never existed. Dates from 1 March 1900 onward are correct, so this rarely matters in practice. A second system, the 1904 date system, starts counting from a different day. A later chapter explains it and the problems it can cause when you combine workbooks.
Common mistakes
- A date turns into a five-digit number. The cell format was reset to General or Number. Reapply a date format. Nothing is lost.
- A number turns into a date. The opposite happened: a date format was applied to a plain number. Apply General to see the number.
- The date is left-aligned and will not calculate. It is probably text, not a serial number.
Exercise
A cell contains the date 1 January 2023, whose serial number is 44927. Without typing anything into Excel, what serial number does 31 January 2023 have, and what does a cell holding it show if its format is General?
Show answer
Serial numbers count days, so 31 January 2023 is 30 days after 1 January 2023: 44927 + 30 = 44957. With the General format, the cell shows 44957.