How to Count Days Between Two Dates in Google Sheets
Type =B2-A2 to get the number of days between an earlier date in A2 and a later date in B2 — just format the result as a plain number.
=B2-A2
Dates are stored as numbers, so subtracting them gives the day count. If the cell shows a date instead of a number, set the format to Number.
How it works
Google Sheets stores every date as a serial number, so the difference between two dates is simply subtraction. The only common surprise is formatting: the result cell may inherit a date format and show something like 1900-02-14 instead of 45. Fix it with Format > Number > Number. For business-day counts, use NETWORKDAYS instead, which skips weekends.
Variations
Workdays only (skip weekends)
=NETWORKDAYS(A2,B2)
Counts Monday–Friday between the two dates, inclusive.
Workdays excluding holidays
=NETWORKDAYS(A2,B2,E2:E10)
List holiday dates in E2:E10 to subtract them too.
Whole weeks between dates
=INT((B2-A2)/7)
Divides the day count by 7 and rounds down.
Examples
| Scenario | Formula |
|---|---|
| Days until a deadline in B2 | =B2-TODAY() |
| Working days on a project | =NETWORKDAYS(A2,B2) |
FAQ
Why does my result show a date, not a number?
The cell is date-formatted. Select it and choose Format > Number > Number, or wrap the formula: =TEXT(B2-A2,"0").
Does =B2-A2 include both the start and end day?
No — plain subtraction counts the gap, so a Monday-to-Friday span returns 4. Add 1 if you want to count both endpoints: =B2-A2+1.
How do I count only working days?
Use =NETWORKDAYS(A2,B2), which counts weekdays and can exclude a holiday list as a third argument.
Related formulas
- ROUNDUP and ROUNDDOWN in Google Sheets
- SUMPRODUCT in Google Sheets
- TODAY Function in Google Sheets
- TRIM Function in Google Sheets
- UPPER, LOWER and PROPER in Google Sheets
- Circular Dependency Error in Google Sheets — How to Fix It
- #DIV/0! Error in Google Sheets — Fix Division by Zero
- #ERROR! in Google Sheets — Fix Formula Parse Errors