Learning Excel: Date calculations
Calculating with dates
How many days to go until the wedding? How old will Thomas be on the big day? And does the menu tasting really fall on a Saturday? Because dates are numbers, each answer is a small formula.
Days in between
Subtract one date from another and you get the number of days in between. =B7-B2 gives 209: that's how many days there are between booking the venue and the wedding.
Put a result like that in a cell with a number format, like column C. In a date column you'd see a strange date in 1900.
=B7-B2
| A | B | C | D | |
|---|---|---|---|---|
| 1 | What | Date | Number | Date |
| 2 | Book the venue | 11/15/2026 | ||
| 3 | Send the invitations | 1/30/2027 | ||
| 4 | Menu tasting | 3/6/2027 | ||
| 5 | RSVP deadline | 4/10/2027 | ||
| 6 | Dress fitting | 5/8/2027 | ||
| 7 | Wedding | 6/12/2027 | 209 | |
| 8 | Ellie born | 3/14/1996 | ||
| 9 | Thomas born | 11/2/1994 | ||
| 10 |
DATEDIF
For whole years or months you use DATEDIF: the start date, the end date and a unit. "Y" counts whole years, "M" whole months and "D" days.
In C8, =DATEDIF(B8,B7,"Y") gives 31: Ellie's age on the wedding day. Excel doesn't suggest this function as you type, but it works all the same.
=DATEDIF(B8,B7,"Y")
| A | B | C | D | |
|---|---|---|---|---|
| 1 | What | Date | Number | Date |
| 2 | Book the venue | 11/15/2026 | ||
| 3 | Send the invitations | 1/30/2027 | ||
| 4 | Menu tasting | 3/6/2027 | ||
| 5 | RSVP deadline | 4/10/2027 | ||
| 6 | Dress fitting | 5/8/2027 | ||
| 7 | Wedding | 6/12/2027 | ||
| 8 | Ellie born | 3/14/1996 | 31 | |
| 9 | Thomas born | 11/2/1994 | ||
| 10 |
WEEKDAY
WEEKDAY gives the day of the week as a number. Without a second argument the week starts on Sunday. With 2, Monday is 1 and Sunday is 7, the way the week runs on a British calendar.
=WEEKDAY(B7,2) gives 6: the wedding falls on a Saturday.
=WEEKDAY(B7,2)
| A | B | C | D | |
|---|---|---|---|---|
| 1 | What | Date | Number | Date |
| 2 | Book the venue | 11/15/2026 | ||
| 3 | Send the invitations | 1/30/2027 | ||
| 4 | Menu tasting | 3/6/2027 | ||
| 5 | RSVP deadline | 4/10/2027 | ||
| 6 | Dress fitting | 5/8/2027 | ||
| 7 | Wedding | 6/12/2027 | 6 | |
| 8 | Ellie born | 3/14/1996 | ||
| 9 | Thomas born | 11/2/1994 | ||
| 10 |
Try it yourself
How many days are left until the wedding? Work it out in C7.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | What | Date | Number | Date |
| 2 | Book the venue | 11/15/2026 | ||
| 3 | Send the invitations | 1/30/2027 | ||
| 4 | Menu tasting | 3/6/2027 | ||
| 5 | RSVP deadline | 4/10/2027 | ||
| 6 | Dress fitting | 5/8/2027 | ||
| 7 | Wedding | 6/12/2027 | ||
| 8 | Ellie born | 3/14/1996 | ||
| 9 | Thomas born | 11/2/1994 | ||
| 10 |
Ready for more?
The full lesson has 4 exercises, from easy to challenging, with hints, points and a streak you can build.
Start the lesson