To calculate the number of days between two dates in Excel, put the earlier date in A2 and the later date in B2, then enter =B2-A2 in another cell. To count the days from a date in A2 through today, use =TODAY()-A2; TODAY updates when Excel recalculates the workbook.
Set up a simple date calculator
In Microsoft Excel for Microsoft 365 on Windows, enter real dates in two cells, such as A2 and B2. A date can be typed in a familiar format such as 1/10/2026, though how Excel interprets that entry depends on your regional date settings. Put the calculation in C2. If A2 contains January 10, 2026, and B2 contains January 25, 2026, enter =B2-A2 in C2. The result is 15 days: the elapsed time from the start of January 10 to the start of January 25.
Excel stores recognized dates as serial numbers, so subtracting one date from another gives a number of days. If C2 displays another date instead of 15, the calculation may still be correct; the result cell is probably formatted as a date. Select C2, then choose Home > Number Format dropdown > General or Number. You can also press Ctrl+1 on Windows, select the Number tab, and choose General or Number.
A practical layout can include a description, the two dates, and the result:
- A1: Start date; A2: 1/10/2026
- B1: End date; B2: 1/25/2026
- C1: Days between; C2: enter the subtraction formula
What the result means
Subtracting dates returns elapsed days, not a count that includes both endpoint dates. From January 10 to January 25 is 15 elapsed days, even though the calendar shows 16 dates if you count January 10 and January 25 themselves. Neither convention is universally right: use elapsed days for durations, and an inclusive count when the question is how many calendar dates a period covers.
With the earlier date in A2 and the later date in B2, an inclusive count is =B2-A2+1. For January 10 through January 25, the result is 16. This convention is often useful for event schedules, date ranges, or tracking a period in which both the first and final dates count. Be clear about whether a report needs elapsed days or inclusive calendar days before sharing the number.
If users might enter the dates in either order, an absolute difference avoids a negative result. With the two dates in A2 and B2, =ABS(B2-A2) returns 15 for January 10 and January 25, regardless of which cell contains the earlier date. This is appropriate when you only need the distance between dates. It is not appropriate when the sign matters, such as identifying whether a deadline is still ahead or has passed.
Use TODAY to compare a date with the current date
TODAY returns the current date according to Excel’s calculation environment, without a time component. If A2 contains January 10, 2026, then a formula that subtracts A2 from TODAY gives the number of elapsed days since that date. With A2 containing the start date, enter =TODAY()-A2. On November 3, 2026, the result is 297 days. On a later date, it will be different because TODAY is recalculated.
To calculate days remaining until a future deadline in A2, reverse the subtraction: use =A2-TODAY(). If the date is in the future, the result is positive; if it has passed, the result is negative. For a simple status label, a formula can compare the date with TODAY, but keep the numeric day count in its own cell if you need to sort, chart, or use it in later calculations.
TODAY is dynamic, unlike a date typed directly into a cell. Excel normally recalculates it when the workbook opens or when calculation occurs. If the result appears not to change, check Formulas > Calculation Options and confirm that Automatic is selected. Pressing F9 recalculates formulas in Excel for Windows. On a Mac, the recalculation shortcut is typically Fn+F9, though keyboard settings can affect function keys. If you need a fixed date stamp rather than a changing date, enter a date as a value instead. Ctrl+; inserts the current date as a fixed value in Excel for Windows; on Mac, Control+; is the usual equivalent.
Count working days instead of calendar days
A standard subtraction counts Saturdays, Sundays, and holidays. If you need weekdays only, Excel’s NETWORKDAYS function counts working days between two dates, including both endpoints when they are workdays. With a Monday start date in A2 and a Friday end date in B2 for the same ordinary workweek, enter =NETWORKDAYS(A2,B2). For January 12 through January 23, 2026, the result is 10 weekdays.
NETWORKDAYS can also exclude a holiday list. Put holiday dates in D2:D4, for example, then use =NETWORKDAYS(A2,B2,D2:D4). The holiday entries must be actual Excel dates; text that only looks like a date may not be recognized. NETWORKDAYS treats Saturday and Sunday as weekends. If the weekend falls on different days, Excel provides NETWORKDAYS.INTL, which lets you specify a weekend pattern. Confirm the function’s weekend code or string against Excel’s function help before relying on it for a work schedule.
Working-day counts are not the same as elapsed hours or paid days. NETWORKDAYS counts qualifying dates, not shifts, partial days, or local labor rules. For a schedule with unusual weekends, shift patterns, or company-specific closures, make the assumptions visible and keep the holiday list current. A clear label such as “weekdays, excluding listed holidays” helps prevent someone from interpreting the result as calendar days.
Choose the right calculation for the question
The simplest formula depends on what “between two dates” means in your situation. Use these distinctions before building a larger tracker:
- Elapsed calendar days: subtract the start date from the end date. The start date is not counted as a full elapsed day.
- Inclusive calendar dates: subtract and add 1 when both the first and last dates count.
- Distance regardless of order: use ABS around the subtraction when the dates may be entered backwards.
- Days from a date to today: subtract the stored date from TODAY, or reverse the order to find days remaining.
- Weekdays: use NETWORKDAYS, optionally with a range of holiday dates.
For example, a project that starts on Monday and ends on Friday has four elapsed days between those dates, but five inclusive calendar dates. A weekday count is five if neither date is a holiday. Those answers differ because they answer three different questions, not because one formula is faulty.
Prevent common date and formula problems
If subtraction returns a negative number, check which date is in which cell. A negative result simply means the first date in the subtraction is later than the second. Use the absolute-difference method only if order is irrelevant; otherwise, correct the date order or retain the negative value because it communicates that the date range is reversed.
If Excel returns #VALUE!, one or both entries may be text rather than recognized dates. Re-enter the date using a format your regional settings understand, or use Data > Text to Columns to convert imported text dates when appropriate. A date displayed as a serial number is usually a formatting issue: apply a date format to the input cells. Conversely, apply General or Number to the result cell to display a day count.
Dates that look ambiguous deserve special attention. For example, 03/04/2026 can mean March 4 or April 3 depending on the workbook’s locale and how the entry was imported. Use an unambiguous format such as 4-Mar-2026 where suitable, or inspect the actual date value and regional settings. Formatting changes how a value appears; it does not necessarily repair a text date or reinterpret a wrongly parsed entry.
Excel workbooks can use different date systems, most commonly the 1900 and 1904 systems. A workbook’s setting is found under File > Options > Advanced in Excel for Windows, in the section for calculating the workbook. This is mainly relevant when dates or formulas are transferred between older workbooks or systems; it can create an offset in displayed dates. Avoid changing the setting casually in an established workbook because it can affect existing date values. In Excel for Mac, workbook calculation settings are available through Excel > Preferences or Settings, with the exact wording depending on the release.
Make a reusable date calculator
For a small reusable calculator, reserve two input cells and one result cell, label each one, and format the result as a number. To make it easier for others to use, add a note that states whether the answer is elapsed or inclusive days. You can also use Data Validation to limit entries to dates: select the input cells and choose Data > Data Validation, then set Allow to Date. Validation can reduce accidental text or out-of-range entries, but it cannot guarantee that a date is logically correct for a particular project.
For a list of many records, use one row per item, with columns for a name, start date, end date, and day count. Enter the subtraction formula in the first result row and fill it down. If the data is formatted as an Excel table, a formula entered in a table column generally fills through that calculated column as new rows are added. Keep a separate holiday range if the list needs business-day calculations, and make sure formulas point to the correct date columns.
Frequently Asked Questions
How do I calculate the number of days between two dates in Excel?
Put the earlier date in A2 and the later date in B2, then enter =B2-A2 in another cell. Format the result as General or Number if Excel displays it as a date.
How do I count both the start and end date?
With the start date in A2 and end date in B2, use =B2-A2+1. This counts both endpoints, so January 10 through January 25 returns 16 calendar dates.
How do I calculate days remaining until a date?
Put the future date in A2 and use =A2-TODAY(). The result is positive before the date, zero on that date, and negative after it. TODAY changes as Excel recalculates.
Why does Excel show a date instead of a number of days?
The result cell is likely using a date format. Select it and change the number format to General or Number. The underlying subtraction can be correct even when the displayed format is unsuitable.
Can Excel count only weekdays between two dates?
Yes. Use NETWORKDAYS with the start and end cells, and optionally provide a range of holiday dates. It counts weekdays under its weekend rules, not shifts or partial workdays.
Which date method should you use?
For a quick two-date calculator, subtraction is usually the clearest choice: it is easy to inspect and gives elapsed calendar days. Add 1 for an inclusive date count, use ABS if the order should not affect the answer, and use TODAY when the calculation should move with the current date. Choose NETWORKDAYS when weekends and listed holidays should be excluded. Label the result’s meaning, confirm the input cells contain real dates, and the workbook will be much easier to understand and maintain.
Related
- Combine in Excel: Text, Cells, and Data
- Company Contact List Template for Excel
- Combine Excel Files into One: Methods and Best Practices
Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.
More in Formulas & functions
- Filter Excel Rows by Cells That Contain Specific TextTo filter Excel rows by text inside a cell, turn on AutoFilter, open the filter arrow in the…
- Weighted Average in Excel: Formula and ExamplesExcel has no dedicated WEIGHTEDAVERAGE function; use SUMPRODUCT divided by SUM. With values in B2:B4 and their corresponding…
- Excel Filter and Sort by Color: Steps, Options, and TipsIn Excel for Microsoft 365 on Windows, use the filter arrow in a column and choose Filter by…
- Excel Formula to Get a Distinct List (With Examples)In Excel for Microsoft 365, use =UNIQUE(A2:A20) to return a distinct list from the values in A2:A20, with…
- How to Concatenate a New Line in Excel with a FormulaTo join text from two Excel cells with a line break between them, enter =A2&CHAR(10)&B2 in a third…
- Calculate Number of Years in Excel: Dates and FormulasTo calculate the number of complete years between two dates in Excel, enter the earlier date in A2…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.