To count the days between two dates in Google Sheets, subtract the earlier date from the later one: =B2-A2. That works because Sheets stores every date as a number. The methods below cover everything else you might need: counting both dates, counting only working days, skipping holidays and counting up to today.
Tested in Google Sheets. On November 9, 2026 we entered the formulas on this page in Google Sheets, including leap years, holidays, dates stored as text and dates typed inside a formula, and compared the results with values calculated independently. How we test
Quick answer: which formula to use
| You want to count | Formula (start in A2, end in B2) | Example result* |
|---|---|---|
| Days between the dates | =B2-A2 |
25 |
| Days between the dates, with a dedicated function | =DAYS(B2, A2) |
25 |
| Days including both the start and end date | =B2-A2+1 |
26 |
| Working days (Monday to Friday) | =NETWORKDAYS(A2, B2) |
20 |
| Working days, excluding holidays | =NETWORKDAYS(A2, B2, D2:D10) |
19 |
*For a start date of Monday, January 5, 2026 and an end date of Friday, January 30, 2026, with one holiday on Monday, January 19, 2026.
Method 1: Subtract one date from another
Put the start date in A2 and the end date in B2, then enter:
=B2-A2
Google Sheets stores dates as serial numbers (each day is one whole number), so subtracting them returns the number of days in between. From January 5 to January 30, 2026 the result is 25.
If you see a date instead of a number (usually a date in January 1900), the result cell has a date format. Select it and choose Format → Number → Number.
Method 2: The DAYS function
DAYS does the same calculation, but makes the intent clearer when someone else reads your sheet:
=DAYS(B2, A2)
Note the order: the end date comes first, then the start date (DAYS(end_date, start_date)). If you swap them, the result is negative. According to Google’s documentation, DAYS takes leap days into account, so February 1 to March 1 is 29 days in 2028 and 28 days in 2027.
Method 3: DATEDIF with the “D” unit
=DATEDIF(A2, B2, "D")
Here the start date comes first. The result is the same 25 days. DATEDIF is more useful when you need months or years as well as days, for example to calculate someone’s age. See our guide to all six DATEDIF units.
Method 4: Count both the start and end date (inclusive)
Subtraction counts the gaps between dates, not the dates themselves. If a task runs from January 5 to January 30 and both days count, add 1:
=B2-A2+1
That returns 26. Whether you need the +1 depends on what you are counting: hotel nights do not need it, but days of a rental or a holiday usually do. We explain how to choose in inclusive vs exclusive day counts.
Method 5: Count working days only (NETWORKDAYS)
To count Mondays to Fridays and skip weekends:
=NETWORKDAYS(A2, B2)
From Monday, January 5 to Friday, January 30, 2026, the result is 20. NETWORKDAYS counts the start date and the end date if they fall on weekdays, so you do not need to add 1.
Exclude holidays
List your holiday dates in a range, for example D2:D10, and add it as the third argument:
=NETWORKDAYS(A2, B2, D2:D10)
With one holiday on Monday, January 19, 2026, the result drops to 19. Holidays that fall on a weekend are not subtracted twice. For holiday lists on another sheet, other weekend days and adding working days with WORKDAY, see NETWORKDAYS with holidays.
Different weekend days
NETWORKDAYS always treats Saturday and Sunday as the weekend. If your weekend is different, for example Friday and Saturday, use NETWORKDAYS.INTL, which lets you choose the weekend days.
Count days from a date until today
Replace one of the dates with TODAY():
=TODAY()-A2
This counts the days since the date in A2. For days remaining until a deadline in B2, use =B2-TODAY(). TODAY updates automatically, so the result changes every day.
Apply the formula to a whole column
If your start dates are in A2:A and end dates in B2:B, one formula can fill the whole column:
=ARRAYFORMULA(IF(A2:A="", "", B2:B-A2:A))
The IF keeps empty rows blank instead of showing results for rows without dates.
Common problems and fixes
The result is #VALUE!
At least one of the “dates” is text that Sheets cannot read as a date. A quick test: real dates are aligned to the right of the cell by default, while text is aligned to the left. Re-enter the date in your spreadsheet’s date format, or convert it with DATEVALUE.
The result is wrong by days or months
Check your spreadsheet’s locale in File → Settings. A date typed as 03/04/2026 means March 4 in the United States but April 3 in the United Kingdom and many other countries.
The result has decimals
If your cells contain a date and a time, subtraction includes the fraction of the day. Use =INT(B2)-INT(A2) to count whole calendar days only.
The result is negative
The start date is later than the end date. Swap the cells, or use =ABS(B2-A2) if you only need the size of the gap.
Typing dates directly into a formula
Avoid writing dates like =NETWORKDAYS(1/5/2026, 1/30/2026): Sheets reads them as divisions, not dates. In our test that formula returned 0 instead of 20, with no error to warn you. Use DATE(year, month, day) instead:
=NETWORKDAYS(DATE(2026, 1, 5), DATE(2026, 1, 30))
More worked examples
| Start (A) | End (B) | =B-A |
=B-A+1 |
=NETWORKDAYS(A, B) |
|---|---|---|---|---|
| Mon, Feb 2, 2026 | Fri, Feb 27, 2026 | 25 | 26 | 20 |
| Sun, Mar 1, 2026 | Tue, Mar 31, 2026 | 30 | 31 | 22 |
| Mon, Dec 22, 2025 | Fri, Jan 9, 2026 | 18 | 19 | 15 (13 if Dec 25 and Jan 1 are holidays) |
Related guides
- Days between dates: inclusive vs exclusive counting
- DATEDIF in Google Sheets: all 6 units explained
- NETWORKDAYS with holidays: exclude holidays from working days
- How to count specific weekdays (for example, all Mondays) between two dates
- How to calculate age from date of birth
- NETWORKDAYS not working? 7 causes and fixes
- How to get the day name from a date
- Date formula generator (free tool)
- Column letter to number converter (free tool)