# How to calculate the number of days between two dates in Excel

Subtract the earlier date from the later one: =C2-B2. Dates are numbers of days, so the difference is the number of days.

**Excel:** `=C2-B2` (Excel 2013 and later)

**Google Sheets:** the same formula works.

## Example

Sample data (row 1 is the header):

| A | B | C | D |
| --- | --- | --- | --- |
| Project | Start | End | Days |
| Website refresh | 2026-01-12 | 2026-03-06 |  |
| Office move | 2026-02-02 | 2026-02-27 |  |
| Audit | 2026-03-16 | 2026-04-03 |  |
| Hiring round | 2026-04-01 | 2026-06-30 |  |

Formula in D2, filled to D5: `=C2-B2`

Result: 53; 25; 18; 90

## How it works

Spreadsheets store a date as the number of days since a starting point, so subtracting one date from another gives the days between them. Format the result as a number: if it inherits the date format it shows as a strange date like 2/22/1900.

## Other ways

- `=DAYS(C2,B2)`: The same result. Note the order: end date first.
- `=C2-B2+1`: Add 1 when both the start and end days count, like a hotel stay or an event. (One more day: both ends are counted.)
- `=NETWORKDAYS(B2,C2)`: Counts working days (Monday to Friday) instead, including both ends. (Weekdays only.)

## Common mistakes

- Dates stored as text (left-aligned) give #VALUE!. Convert them with DATEVALUE or by retyping.
- A negative result means the dates are the wrong way round. Wrap in ABS if order doesn't matter.
- DATEDIF(B2,C2,"d") also works but is undocumented in Excel, so it doesn't appear in autocomplete.

## Questions

**How do I calculate days from a date until today?**

Use `=TODAY()-B2`. It updates every day.

**How do I get the difference in months or years?**

Use `=DATEDIF(B2,C2,"m")` for whole months or `"y"` for whole years.

Every formula and result on this page was checked by running it in the Spreadsheet Practice formula engine on 2026-10-29.

Source: https://spreadsheetpractice.com/formulas/days-between-two-dates
