How to Count Days Between Two Dates

Counting days between two dates looks like something you could just do on your fingers, until the span crosses a month with 31 days, a leap year, or a stretch you need to include both endpoints of. A contract that runs "from March 3 to April 17" doesn't announce how many days that actually is, and manually counting on a calendar is slow and easy to get wrong by exactly one day.

Excel can do this with a single subtraction, plus a couple of variations depending on whether you need every calendar day or only weekdays. This guide covers each method, the mistakes that throw off the count, and a free calculator for when you just need the number.

Quick Answer

To count the days between two dates in Excel, subtract the earlier date from the later one, for example =B2-A2, and format the result cell as Number so it shows a plain day count instead of another date. Add 1 to the result if both the start and end date need to be counted as part of the total, and use NETWORKDAYS instead if weekends should be excluded.

What counts as "days between two dates"?

There isn't one universal answer to "how many days between these two dates" — it depends on whether the endpoints themselves should be counted.

Excel stores every date as a serial number under the hood, which is exactly why subtracting two date cells works at all — it's really just subtracting two numbers.

Why the right count matters

A day miscounted here or there feels harmless until it shows up somewhere that depends on it:

📊 Quick stat The most common source of an off-by-one error in day counts is forgetting to add 1 for an inclusive range — a booking, rental, or notice period that should include both the start and end day almost always needs that extra day added manually.

Step-by-step: counting days in Excel

Method 1: Basic day count with subtraction

  1. Enter both dates in separate cells. Make sure each is formatted as an actual date, not text — for example, A2 as the start date and B2 as the end date.
  2. Click an empty cell for the result. This is where the day count will appear.
  3. Type the subtraction formula.
    =B2-A2
  4. Format the result as Number. Excel sometimes displays the answer as a date; select the cell, open Format Cells, and choose Number or General to see a plain day count instead.

Method 2: Using the DAYS function

  1. Use DAYS instead of manual subtraction for a formula that reads clearly and always returns a number, never a date format.
    =DAYS(B2,A2)
  2. Press Enter. DAYS takes the end date first and the start date second, and returns the same result as subtraction without the formatting quirk.

Method 3: Counting only weekdays

  1. Use NETWORKDAYS to count business days only, automatically skipping Saturdays and Sundays.
    =NETWORKDAYS(A2,B2)
  2. Add a holiday list if needed. Pass a range of holiday dates as a third argument to exclude them from the count as well.
    =NETWORKDAYS(A2,B2,D2:D10)
Just need one date difference, not a spreadsheet? Rebrixe's free Date Difference Calculator gives the exact day count instantly, no formulas required.
Count the Days →

Common mistakes when counting days

1. Forgetting to add 1 for an inclusive range

Plain subtraction counts the gap between two dates, not the dates themselves, so a range meant to include both the start and end day — like a rental period or notice window — will come up one day short unless 1 is added to the result.

2. Storing a date as text

A date typed or pasted in a format Excel doesn't recognize gets stored as text, and subtracting a text "date" from a real one returns a #VALUE! error instead of a day count.

3. Reversing the start and end dates

Subtracting the later date from the earlier one, instead of the other way around, produces a negative number rather than an error — an easy mistake to miss when scanning a column of results.

4. Using calendar days when business days were meant

A plain subtraction includes weekends in the total, which quietly inflates any deadline or turnaround estimate that was actually meant to count only working days.

💡 Pro tip If a date column shows small green error triangles or left-aligns instead of right-aligning in the cell, it's almost always stored as text — reformat the column as Date before subtracting it from anything.

Real-world formula examples

A few common scenarios and the formula each one needs.

Invoice period
Plain day count
=B2-A2
Returns the number of days between two dates, formatted as Number rather than Date.
Hotel booking
Inclusive night count
=B2-A2+1
Adds 1 to include both the check-in and check-out day in the total.
Project deadline
Business days only
=NETWORKDAYS(A2,B2)
Counts weekdays only, excluding Saturdays and Sundays from the span.
Text-formatted import
Converting text to a real date
=DATEVALUE(A2)
Fixes dates imported as text so subtraction and DAYS can read them correctly.

Subtraction vs DAYS vs NETWORKDAYS

A side-by-side look at how the three approaches compare in Excel.

Factor Subtraction (=B2-A2) DAYS function NETWORKDAYS
Counts All calendar days All calendar days Weekdays only
Formatting quirks May display as a date Always a number Always a number
Best for Quick, casual day counts Formulas shared across a team Deadlines, SLAs, work schedules
Can exclude holidays No No Yes, with a holiday range

Skip the spreadsheet: free date difference calculator

If you just need one exact day count and don't want to open Excel, the Rebrixe Date Difference Calculator works entirely in your browser: enter a start and end date, get the exact number of days instantly. No formulas, no account, no data sent anywhere.

Free Date Difference Calculator Enter two dates, get the exact day count instantly.
Open the Calculator →

Frequently asked questions

Subtracting the earlier date from the later date, either with a plain formula in Excel or with an online date calculator, is the fastest way to get the number of days between two dates, since the calendar math is handled automatically.
Subtract the earlier date cell from the later date cell, such as =B2-A2, and format the result cell as a Number rather than a Date so it displays a plain day count instead of another calendar date.
Simple subtraction counts the span between the two dates, not the two dates themselves, so add 1 to the result if both the start and end day need to be included in the total, such as when counting an inclusive rental or booking period.
Excel sometimes inherits date formatting from the cells being subtracted, so the result cell needs to be manually reformatted as Number or General before it will display a plain day count.
Use the NETWORKDAYS function, which counts weekdays between two dates while automatically excluding Saturdays and Sundays, and can exclude a list of holiday dates as well.
A negative result usually means the two dates were entered in the wrong order, since subtracting a later date from an earlier one produces a negative day count instead of an error.
Yes, a free online date difference calculator returns the exact day count instantly from two entered dates, without needing a spreadsheet or any formula knowledge.

Get your exact day count in seconds

Skip the formulas entirely — the Rebrixe Date Difference Calculator handles leap years and month lengths automatically, no spreadsheet required.

Launch the Calculator →
← Back to blogs