Excel course · Lesson 20 of 34
Dates and times: serial numbers, date math and working days
Understand how Excel stores dates and times, calculate due dates, ages and durations, add months, find month ends and count working days.
Dates confuse many Excel users until they learn one fact: a date is just a number. Excel counts days from a fixed starting point, and a time is a fraction of a day. Once you see dates as numbers, adding 30 days to an invoice date, counting the days between two dates or working out hours worked becomes simple arithmetic. This lesson explains the system, then the functions that handle months, ages and working days.
Dates are serial numbers
In Excel for Windows and current Excel for Mac, day 1 is 1 January 1900. Every day after that adds 1. So 1 January 2026 is serial number 46023 and 15 March 2026 is 46096. The date format only changes how that number is displayed.
| Date | Serial number |
|---|---|
| 1900-01-01 | 1 |
| 2026-01-01 | 46023 |
| 2026-03-15 | 46096 |
| 2026-12-31 | 46387 |
- Type
2026-03-15into a cell. Excel recognises it as a date. - Press
Ctrl+1and choose Number › General. The cell shows 46096. - Choose Date again to switch back. Nothing about the value changed.
Times are fractions: 12:00 noon is 0.5, 06:00 is 0.25, and 14:30 is 0.604166…. A date with a time is a number with decimals: 15 March 2026 at 18:00 is 46096.75.
Entering dates reliably
2026-03-15(ISO format) is understood in every region.15-Mar-2026is also unambiguous.03/04/2026is 3 April in Europe and 4 March in the US. Avoid it when sharing files internationally.Ctrl+;inserts today's date as a fixed value;Ctrl+Shift+;inserts the current time (Mac:Cmd+;for the time on some versions;Ctrl+;works for the date).- TODAY returns today's date and NOW the date and time; both update whenever the workbook recalculates.
To build a date from separate numbers, use DATE: =DATE(2026, 3, 15). DATE handles overflow sensibly: =DATE(2026, 14, 1) is 1 February 2027, and =DATE(2026, 3, 0) is the last day of February 2026. To take dates apart, use YEAR, MONTH and DAY.
Date arithmetic
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Invoice | Invoice date | Due date | Paid on | Days late |
| 2 | INV-501 | 2026-02-02 | 2026-03-04 | 2026-03-20 | 16 |
| 3 | INV-502 | 2026-02-16 | 2026-03-18 | 2026-03-10 | -8 |
C2 =B2+30 (payment terms 30 days). E2 =D2-C2 gives days late; negative means early.
Result: 16
- Due date:
=B2+30. February 2026 has 28 days, so 2 February + 30 is 4 March. - Days between two dates: subtract,
=D2-C2. If the result appears as a date such as1900-01-16, change the cell format to General or Number. - Days until a deadline:
=C2-TODAY(). - Days late, never negative:
=MAX(0, D2-C2).
Months, years and ages
Adding months cannot be done by adding 30. Use EDATE to move a date by whole months and EOMONTH to jump to the end of a month.
| Formula | Result | Use |
|---|---|---|
| =EDATE("2026-01-31", 1) | 2026-02-28 | Contract renewal one month later (clamped to month end) |
| =EDATE(B2, 12) | same date next year | Annual review |
| =EOMONTH("2026-02-10", 0) | 2026-02-28 | Last day of the same month |
| =EOMONTH("2026-02-10", 1) | 2026-03-31 | Last day of the next month |
| =EOMONTH(B2, -1)+1 | first day of B2's month | Month start, handy for SUMIFS criteria |
For an age or length of service in whole years, the hidden function DATEDIF is still the simplest. It does not appear in AutoComplete, but it works in every version:
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Employee | Birth date | On date | Age |
| 2 | Laura Kim | 1990-07-14 | 2026-12-02 | 36 |
Complete years between the two dates. Use "m" for months and "d" for days.
Result: 36
=DATEDIF(B2, C2, "y")&" years, "&DATEDIF(B2, C2, "ym")&" months" returns 36 years, 4 months. YEARFRAC returns a fractional number of years (36.38…), useful for interest calculations.
=(C2-B2)/365. Leap years make it wrong around birthdays. Use DATEDIF or INT(YEARFRAC(B2, C2, 1)).Weekdays and working days
- WEEKDAY returns the day number. With the second argument 2, Monday is 1 and Sunday is 7:
=WEEKDAY("2026-03-15", 2)returns 7 (a Sunday). - To show the day name, use the format
ddddor=TEXT(A2, "dddd"), which returnsSunday. - NETWORKDAYS counts working days (Monday–Friday) between two dates, inclusive, minus an optional list of holidays.
- WORKDAY adds a number of working days to a date, skipping weekends and holidays.
- NETWORKDAYS.INTL and WORKDAY.INTL let you choose the weekend, for example Friday–Saturday, or a six-day week.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Start | End | Holiday | Working days |
| 2 | 2026-03-02 | 2026-03-31 | 2026-03-25 | 21 |
March 2026 from Monday the 2nd has 22 weekdays; one holiday leaves 21.
Result: 21
A task that starts on Friday 20 March 2026 and needs 10 working days finishes on =WORKDAY("2026-03-20", 10), which is Friday 3 April 2026. Keep public holidays in a table on a separate sheet and refer to the whole column, so every formula uses the same list.
Working with times
Because times are fractions of a day, the difference between two times is also a fraction. Multiply by 24 to get hours as a normal number, for example to calculate pay.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Start | End | Hours (time) | Hours (number) | Pay at 15/h |
| 2 | 22:00 | 06:30 | 8:30 | 8.5 | 127.5 |
A night shift crosses midnight. MOD(…,1) adds a day when the end is earlier than the start. D2 =C2*24, E2 =D2*15.
Result: 8:30
=B2-A2gives a negative number for a night shift, which Excel displays as#####.=MOD(B2-A2, 1)fixes it.- Totals of more than 24 hours need the format
[h]:mm(Number formats and custom format codes). - To convert 8.5 hours back to a time, divide by 24:
=8.5/24formatted ash:mmshows8:30. - HOUR, MINUTE and SECOND extract parts; TIME builds a time:
=TIME(8, 30, 0).
Dates stored as text
If a date is left-aligned, subtracting it returns #VALUE! and SUMIFS ignores it. Test with =ISNUMBER(A2). Convert with Data › Text to Columns › Date: DMY (or MDY), with DATEVALUE, or in Power Query with the correct locale. More in Text cleanup: TRIM, CLEAN, TEXTSPLIT, Flash Fill and Text to Columns.
Check yourself
1. What is stored in a cell that shows 2026-01-01?
Dates are serial numbers; 2026-01-01 is day 46023.
2. Which formula returns the same day one month later, adjusted for short months?
EDATE moves by whole months and clamps to the last day when needed.
3. A shift starts at 22:00 and ends at 06:00. Which formula gives 8:00?
MOD(…,1) wraps negative differences around midnight. ABS would give 16:00.
4. C2 contains 7:30 (a time). Which formula gives the pay at 20 per hour?
Convert the fraction of a day to hours by multiplying by 24, then by the rate: 7.5×20 = 150.
5. Which function counts weekdays between two dates, excluding holidays?
NETWORKDAYS counts Monday–Friday and subtracts an optional holiday list.