Sub topic 5
Entering Dates and Times
This chapter assumes you can select a cell, type an entry, and commit it with Enter. It also assumes you know the difference between text and numbers, which an earlier chapter covered. Here you will learn how Excel turns typed dates and times into serial numbers. You will also learn which entries Excel does not recognize and how to fix the common mistakes.
How Excel stores a date
Excel does not store a date as the characters you typed. It stores a number called a serial number. Serial 1 is January 1, 1900, and each later day adds 1. So 2026-11-27 is stored as a number near 46,000, and the cell's number format makes it look like a date.
A time is the fractional part of that number. Noon is 0.5, because it is half of a day. 6:00 AM is 0.25. A date with a time, such as November 27, 2026 at 6:00 PM, is the whole-day number plus 0.75.
This is why dates can be added, subtracted, and sorted. Subtracting one date from another gives the number of days between them.
=B2-A2If A2 holds a start date and B2 holds an end date, this formula returns the number of days between them. If the result appears as a date, change the cell's number format to General or Number.
Typing a date Excel will recognize
When you commit an entry, Excel tests whether it matches a date pattern. If it does, Excel stores a serial number and applies a date format. If it does not, Excel stores the entry as text.
Common patterns that Excel usually recognizes:
| You type | Excel usually stores |
|---|---|
| 11/27/2026 | November 27, 2026 (in a US-English setup) |
| 27-Nov-2026 | November 27, 2026 |
| Nov 27 | November 27 of the current year |
| 27 Nov 2026 | November 27, 2026 |
| 2026-11-27 | November 27, 2026 |
| 11/27 | November 27 of the current year |
The month names and the order of day, month, and year depend on your computer's regional settings. Excel reads 3/4/2026 as March 4 on a US setup and as April 3 on a setup that uses day-month-year order. The same keystrokes can mean two different dates on two different computers.
Two-digit years
If you type a year with two digits, Excel decides the century. In the default Windows setting, the years 00 to 29 are read as 2000 to 2029, and 30 to 99 are read as 1930 to 1999. So 1/1/29 becomes 2029 and 1/1/30 becomes 1930. Type all four digits when the century matters.
Shortcuts for today and now
Two shortcuts enter the current date or time as a fixed value.
- Press Ctrl+; (semicolon) to enter today's date.
- Press Ctrl+Shift+; to enter the current time.
These insert a value that never changes. To enter both, press Ctrl+; then a space, then Ctrl+Shift+;.
Functions give you a value that updates.
=TODAY()=TODAY() returns today's date and recalculates each time the workbook opens or recalculates. =NOW() returns the date and the time. Use the shortcut for a record such as "date received", which must stay fixed. Use the function for something like "days until deadline", which should change.
Entering times
Type the hours and minutes separated by a colon, for example 14:30. Add seconds with a second colon, as in 14:30:15.
Excel uses a 24-hour clock unless you add AM or PM. Type 2:30 PM with a space before PM. Without the AM or PM, 2:30 is read as 2:30 in the morning.
Times over 24 hours
A time of day wraps at 24 hours, but a duration can be longer. If you type 30:00, Excel stores 1 day and 6 hours, and the cell shows 6:00 AM by default. To show elapsed hours, apply the custom number format [h]:mm, where the square brackets tell Excel to keep counting hours past 24. Then the cell shows 30:00.
Checking whether Excel understood you
Excel gives two clues after you press Enter.
- Alignment. By default, numbers, dates, and times align to the right of the cell. Text aligns to the left. A date that sits at the left edge was probably stored as text.
- The Number Format box. With the cell selected, the Home tab shows the format. It shows Date or Time if Excel recognized the entry. It shows General for text.
You can confirm with a formula.
=ISNUMBER(A1)This returns TRUE if A1 holds a real date or time (a number) and FALSE if it holds text.
Common errors and how to fix them
The cell shows a number such as 46353
The cell holds a real date, but its format is General or Number. Select the cell, open the Number Format box on the Home tab, and choose Short Date or Long Date. The stored value does not change, only its display.
The cell shows #####
The column is too narrow for the formatted date, or the value is a negative date or time. Widen the column first. If the cells still show hash signs, check for a subtraction that gave a negative result, because dates and times cannot be negative in the default 1900 date system.
A date was read as text
Typical causes are a mistyped separator, a period used where the regional settings expect a slash, or a leading apostrophe. If a date stays left-aligned, retype it in a form Excel recognizes. For imported data, the DATEVALUE function converts a text date to a serial number.
=DATEVALUE("27-Nov-2026")This returns the serial number for November 27, 2026. Format the result as a date to read it.
The day and month are swapped
This happens when the regional order differs from the order you typed. If you typed 4/3/2026 meaning April 3 on a day-first computer, you get March 4. Retype the entry with a month name to avoid the problem.
Dates before 1900
Excel cannot store a date before January 1, 1900 as a real date. An entry such as 1/1/1850 becomes text. If you must keep older dates, store them as text, or place the year, month, and day in separate columns.
A date turned into something else
Excel reads some entries as dates when you did not intend it. Typing 1-2 or 3/4 produces a date, and a gene name such as SEPT2 can become September 2. To keep the entry as typed, put an apostrophe in front, as in '3/4. The apostrophe makes the cell text and is not displayed.
Changing how a date looks without changing its value
To change the display, select the cells and press Ctrl+1 to open Format Cells. On the Number tab, pick Date or Time, or choose Custom and type a code.
| Code | Meaning | Example for 2026-11-27 |
|---|---|---|
| d | Day without a leading zero | 27 |
| dd | Day with two digits | 27 |
| ddd | Short weekday name | Fri |
| dddd | Full weekday name | Friday |
| mmm | Short month name | Nov |
| yyyy | Four-digit year | 2026 |
The code dddd, mmm d, yyyy displays Friday, Nov 27, 2026. The cell still stores the same serial number, so formulas that use it are unaffected. The next chapter covers stored and displayed values in detail.
Summary of the main rules
- Excel stores dates as whole numbers and times as fractions.
- A recognized entry is right-aligned. A left-aligned date is probably text.
- Regional settings decide the order of day, month, and year, so use a month name in shared files.
- Ctrl+; enters a fixed date, and
=TODAY()enters a changing one. - Use the
[h]:mmformat for durations over 24 hours.
Exercise
In a cell you type 14/3/2026 on a computer set to US-English regional settings. The entry is left-aligned. What happened, and how can you confirm it with a formula and fix it?
Show answer
The US setting expects month first, so 14 is not a valid month and Excel stored the entry as text, which explains the left alignment. Confirm with =ISNUMBER(A1), which returns FALSE for text. Fix it by retyping the date as 3/14/2026, or better as 14-Mar-2026, which does not depend on the order setting. For imported text dates, use a formula such as =DATEVALUE("14-Mar-2026") on a form Excel can read.
Exercise
A cell holds a start time of 8:00 AM, and another holds an end time of 6:30 PM the same day. You subtract the start from the end and the result shows 10:30 AM. How do you make the cell show the length of the shift in hours and minutes, and how do you show it as a decimal number of hours?
Show answer
The result is 0.4375 of a day, which is 10 hours 30 minutes, but the cell uses a time format so it reads as a clock time. Apply the custom format [h]:mm to show 10:30 as a duration. For decimal hours, multiply the difference by 24, as in =(B1-A1)*24, and format the cell as Number, which gives 10.5.