TodayFree forever - no sign-up, no paid plans

How to calculate days between dates in Excel (NETWORKDAYS and DATEDIF)

Open the Days Between Calculator

Excel stores every date as a serial number - the count of days since January 1, 1900 - which makes date arithmetic almost embarrassingly simple once you know the trick. There are three levels to it: plain subtraction for elapsed days, DATEDIF for tidy years-months-days breakdowns, and NETWORKDAYS for working days with weekends and holidays removed. Here is each one, with the traps that catch people out.

Level 1: plain subtraction

Put the start date in A1 and the end date in B1, then in a third cell type =B1-A1. With March 15, 2026 in A1 and June 3, 2026 in B1, the answer is 80 - the same 80 days the days between calculator gives for that span. Add 1, as in =B1-A1+1, if your situation counts both the first and the last day.

The classic trap: Excel often formats the result cell as a date, so instead of 80 you see a day in March 1900. The value is correct; only the costume is wrong. Select the cell, press Ctrl+1, and set the format to General or Number. If you see a row of hash symbols, the column is simply too narrow, or the end date is earlier than the start date and the negative result cannot be displayed as a date.

Level 2: DATEDIF for breakdowns

DATEDIF is Excel's undocumented veteran - it works in every modern version but does not appear in the formula autocomplete. Its syntax is =DATEDIF(start, end, unit), and the units that matter are "d" for total days, "y" for whole years, "m" for whole months, "ym" for months left over after whole years, and "md" for days left over after whole months.

Worked example: from March 15, 2024 to August 20, 2026. =DATEDIF(A1,B1,"d") returns 888 total days. The breakdown formulas return y = 2, ym = 5 and md = 5, which reads as 2 years, 5 months and 5 days - exactly how a person would say it. One caution: the "md" unit has a known quirk in some versions and can return a negative or odd value around month ends. If an "md" result looks wrong, cross-check with the total-days figure and a quick look at a calendar.

Calculating days between dates in Excel on a laptop at a desk

Level 3: NETWORKDAYS for working days

When the count should skip weekends, use =NETWORKDAYS(A1,B1). Add a holiday list as the third argument - one date per cell - and those dates are removed too: =NETWORKDAYS(A1,B1,H1:H11). Our guide on how to count business days between two dates explains the underlying rules if you want to check a result by hand.

One behavior surprises everyone the first time: NETWORKDAYS counts both the start date and the end date when they are weekdays. From Monday, January 5, 2026 to Friday, January 16, 2026, NETWORKDAYS returns 10, while the elapsed-time method used by courts and by this site returns 9. Both are internally consistent; they differ on whether the start day is in or out. If your spreadsheet has to match a deadline calculated the legal way, subtract 1 or shift the start date forward a day, and note what you did in the sheet so the next person is not confused.

When your weekend is not Saturday and Sunday

NETWORKDAYS.INTL takes a weekend code as its third argument, so a Friday-Saturday weekend, a Sunday-only weekend, or any custom pattern can be counted correctly, with holidays moving to the fourth argument: =NETWORKDAYS.INTL(A1,B1,7,H1:H11) uses a Friday-Saturday weekend. This matters more than people expect - a meaningful share of the world does not rest on Saturday and Sunday, and plenty of shift operations rest on other days entirely.

Counting from today, and a small worked sheet

Many real sheets are not about two fixed dates at all - they track a moving target. Excel's TODAY() function returns the current date and recalculates every time the sheet opens, which gives you two endlessly useful patterns. =TODAY()-A1 counts the days since the date in A1: subscription ages, days since a delivery, days an invoice has been outstanding. =A1-TODAY() counts down to a future date in A1: days until a renewal, a filing deadline or a warranty expiry. A negative result from the second pattern is not an error; it is the sheet telling you the date has passed and the count has flipped into days-since territory.

Picture a simple renewals tracker. Column A holds the service, column B the last renewal date, column C the next due date. Column D, =C2-TODAY(), shows days remaining and sorts the whole list into urgency order with one click. Column E, =NETWORKDAYS(TODAY(),C2), shows the same runway in working days, which is the number a manager actually staffs against. Two formulas, and the sheet answers the two questions every operations meeting asks: how long have we got in calendar terms, and how long have we got in working terms? Build the holiday list once on a separate tab, point NETWORKDAYS at it, and the working-day column stays honest all year.

Errors you will meet, and what they mean

#VALUE! means one of your "dates" is actually text. It often happens with dates pasted from another system. Retype the date or use DATEVALUE to convert it. #NUM! from DATEDIF means the start date is after the end date. A result that is right but looks like a date in 1900 is the formatting trap from Level 1. And a count that is exactly one more than a colleague's hand count is almost never an error at all - it is the inclusive versus exclusive difference, which our guide on inclusive vs exclusive counting explains in full. For a quick independent check of any of these formulas, run the same two dates through the days between calculator and compare.

Frequently asked questions

Why does my subtraction show a date instead of a number?

Excel guessed that a cell containing a date calculation should be formatted as a date, so your answer of 80 is displayed as a date in March 1900. Select the cell, open Format Cells, and choose Number or General. The value was right all along; only the display was wrong.

What is the difference between NETWORKDAYS and simple subtraction?

Subtraction counts every calendar day between the two dates. NETWORKDAYS counts only Monday to Friday days, and it can also remove a list of holidays you supply. Use subtraction for elapsed time and NETWORKDAYS for working time.

Does NETWORKDAYS count the start and end dates?

Yes, both of them, if they are weekdays. That is why NETWORKDAYS often returns one more than a hand count done with the elapsed-time method, which excludes the start day. Neither is wrong; they are answering slightly different questions.

How do I remove holidays from a day count in Excel?

List your holidays in a range of cells, one date per cell, and pass that range as the third argument: =NETWORKDAYS(A1,B1,H1:H11). Excel removes any of those dates that fall on a weekday inside your span.

Why does DATEDIF give a #NUM! error?

Because the start date is after the end date. DATEDIF refuses to count backwards. Swap the two dates, or wrap the formula in ABS if you only care about the size of the gap and not its direction.

Related guides

How to calculate days between dates in Google Sheets

The same formulas in Sheets, plus TODAY-based counts that update themselves.

How to count business days between two dates

Weekends, holidays and the rules banks and employers actually use.

How to calculate days between two dates by hand

The midnight method and the day-of-year method, with worked examples.

Off-by-one errors - the most common days between mistake

Why your count is one day out, and how to fix it for good.

Daniel Mercer

Daniel Mercer builds and maintains the calculators on this site. He spent ten years in payroll and operations roles counting business days, notice periods and deadlines by hand, and writes these guides the way he would explain the count to a colleague - the rule first, a worked example second, and the common mistake called out before it happens.