To calculate days between two dates in Excel, subtract the earlier date from the later one: with a start date in A2 and an end date in B2, enter =B2-A2. To count days from a date in A2 through today, use =TODAY()-A2; the result updates as the current date changes.
The simplest formula for two dates
Excel stores dates as numbers, so subtraction gives the number of days between them. Put the earlier date in A2 and the later date in B2, then enter the formula in another cell. For example, if A2 is January 1, 2026, and B2 is January 10, 2026, the result is 9 days. The first date is not counted as a complete day after itself: this is the elapsed-day difference between the two dates.
Before entering the formula, the assumed layout is a start date in A2 and an end date in B2. The formula is =B2-A2. With January 1 and January 10, 2026 in those cells, it returns 9.
You can copy the formula down a column to calculate a separate difference for every row. If the dates are in different columns, substitute those cell references. For example, with starts in C2 and ends in D2, the same calculation is =D2-C2. Keep the later date first if you want a positive number; subtracting a later start date from an earlier end date returns a negative result.
How Excel stores and calculates dates
Excel treats a valid date as a serial number, with each whole-number step representing one calendar day. That is why subtraction works without a special date-difference operator. The displayed date may look like “Jan 10, 2026,” but the underlying value is numeric. If a cell contains text that only looks like a date, Excel may not recognize it as a date, and subtraction can return an error or an unexpected result.
The formula returns a number, not a sentence such as “9 days.” Format the result cell as General or Number to see the count clearly. If Excel displays the result as a date, select the result cell and choose Home > Number Format, then select General or Number. The exact format controls how the value appears; it does not change the calculation.
Dates also have an order. The difference between January 1 and January 10 is 9, whereas the number of dates touched when counting both January 1 and January 10 is 10. This distinction is important for bookings, project spans, and attendance counts, and is the reason an inclusive-count formula adds one.
Calculate days from a date to today
The TODAY function returns the current date according to the computer or Excel calculation environment. Subtract a start date from TODAY to get the number of days that have elapsed since it. The formula recalculates when Excel recalculates the workbook, so its result changes over time; it is not a fixed record of the count on the day you first entered it.
Assume A2 contains November 1, 2026, and you want the elapsed days through November 2, 2026. Enter =TODAY()-A2; on November 2, 2026, it returns 1. On another date, the result will differ. TODAY does not take an argument, so do not add a date or cell reference inside its parentheses.
For a date in the future, this subtraction returns a negative number until that date arrives. If you would rather show zero instead of a negative number, with the target date in A2 use =MAX(0,TODAY()-A2). For a countdown showing days remaining until a future date, with that date in A2 use =A2-TODAY(). These formulas describe different questions, so choose the direction that matches whether you need elapsed days or days remaining.
Choose between subtraction, DAYS, and DATEDIF
Subtraction is usually the clearest choice for ordinary date differences. Excel also provides DAYS, which makes the end-date-first order explicit in its arguments. With a start date in A2 and an end date in B2, enter =DAYS(B2,A2); for January 1 to January 10, 2026, it returns 9. The order matters: DAYS takes the end date first and the start date second.
DATEDIF can return differences in days, months, or years, and is useful when a task specifically calls for a whole-unit interval. With the start date in A2 and the end date in B2, enter =DATEDIF(A2,B2,"d"); for January 1 to January 10, 2026, it returns 9. The quoted letter d requests days. DATEDIF is supported for compatibility, but it is not listed in Excel’s function autocomplete, so it may not appear as you type. For a straightforward day count, subtraction or DAYS is generally easier to read.
DATEDIF expects the start date to be no later than the end date. A reversed date order can return a #NUM! error. Ordinary subtraction can represent a reversed order as a negative count, which can be preferable when negative durations are meaningful. Neither method automatically counts both endpoint dates; add one to the difference if that is what your definition requires.
Inclusive counts and weekdays
For a schedule that counts both the start and finish date, add one to the basic difference. Assume A2 is January 1, 2026, and B2 is January 10, 2026. Use =B2-A2+1; the result is 10 calendar dates. This is useful for a date range described as “January 1 through January 10,” but it is not the right choice for measuring elapsed time. Decide whether endpoints should count before choosing the formula.
If you need Monday-to-Friday workdays rather than calendar days, use NETWORKDAYS. With a start date in A2 and an end date in B2, enter =NETWORKDAYS(A2,B2). This counts weekdays and includes both endpoints when they are working days; Saturday and Sunday are excluded by default. For the range January 5 through January 9, 2026, it returns 5. Holidays are not excluded unless you provide them as a separate argument.
For holidays listed in H2:H10, with the start date in A2 and end date in B2, use =NETWORKDAYS(A2,B2,H2:H10). It counts weekdays in the range and excludes dates in the holiday list. NETWORKDAYS.INTL is another option when the weekend pattern differs from Saturday and Sunday. Its weekend argument can specify alternate weekend days, so check the function’s argument choices for the particular work schedule rather than assuming every workplace uses the default week.
Dates that include times
A cell can contain a date and a time, even if its display format shows only the date. Excel stores the time as a fraction of a day: for example, a half-day difference can appear as 0.5 when the result is formatted as a number. Thus, subtracting two date-time values measures elapsed time in days, not necessarily the number of date boundaries crossed.
If A2 and B2 contain date-time values and you want the count of whole 24-hour periods, subtract them and apply INT. With the start date-time in A2 and the end date-time in B2, use =INT(B2-A2). If you instead want the difference between the calendar dates while ignoring the times, with those same cells use =INT(B2)-INT(A2). These answer different questions: a 23-hour interval crossing midnight may involve two calendar dates but contains zero complete 24-hour periods.
When the output appears as a clock time or date, change the result cell’s format to General or Number to inspect the numeric day value. If you need hours rather than days, multiply the difference by 24. With a start date-time in A2 and an end date-time in B2, =(B2-A2)*24 returns elapsed hours, including a fractional hour where applicable.
Common errors and ways to fix them
A formula that returns #VALUE! often points to a date stored as text or to a cell containing non-date characters. Check whether the input is a real Excel date by changing its number format to General: a recognized date displays as a serial number. If importing data, use Excel’s date conversion tools or correct the source values, and confirm that the day-month order matches your regional settings. Text such as 03/04/2026 can mean different dates in different locales.
A result displayed as a date is commonly a formatting issue, not a bad subtraction. Select the result and choose General or Number. A negative result usually means the dates are in the opposite order from what you intended; reverse the cell references if you want a positive elapsed count. If a formula using TODAY seems not to update immediately, Excel may be set to manual calculation. On Windows, check Formulas > Calculation Options > Automatic; the workbook may need recalculation after changing this setting.
- Unexpected decimal: One or both inputs contain times. Decide whether to retain fractional days or use INT to remove the time component.
- Wrong number of days: Determine whether your requirement is elapsed days or an inclusive count; an inclusive range adds one.
- Formula appears as text: The formula cell may be formatted as Text, or the entry may start with an apostrophe. Change the format to General and re-enter the formula.
- Different results on different machines: Check the actual stored dates and regional date interpretation, especially for imported text.
Practical examples and choosing the right count
Consider a project running from March 3 to March 12. If the question is how much time elapses between the dates, subtract the start from the end: the result is 9 days. If the project is active on every date from March 3 through March 12 and the question is how many calendar dates it covers, the inclusive answer is 10. If the question is how many weekdays it spans, NETWORKDAYS gives a separate answer because weekends and possibly holidays are excluded.
For a recurring report, keep the start and end dates in separate cells rather than typing date values directly into every formula. This makes the calculation easier to audit and lets you update the inputs without rewriting formulas. Label the output clearly, such as “Elapsed calendar days,” “Inclusive dates,” or “Weekdays excluding holidays.” Those labels prevent a correct formula from being misread as answering a different counting question.
Choose the method based on the meaning of “days” in your task:
- Elapsed calendar days between two dates: subtract the start from the end.
- Days from a date through today: subtract the start date from TODAY.
- Both endpoint dates count: add one to the subtraction result.
- Weekdays only: use NETWORKDAYS, adding a holiday range if needed.
- Values include times: decide whether you want fractional elapsed days, full 24-hour periods, or calendar-date boundaries.
Frequently Asked Questions
What is the formula to count days between two dates in Excel?
Put the start date in A2 and the end date in B2, then enter =B2-A2. The result is the elapsed number of days; add one only when the count should include both endpoint dates.
How do I calculate days from a date until today?
If A2 contains the date to count from, use =TODAY()-A2. The answer updates with the current date and can be negative when A2 is in the future.
Why does Excel show a date instead of the number of days?
The result cell is likely formatted as a date. Change its number format to General or Number using Home > Number Format; the underlying subtraction result remains the same.
Does the date difference include the start and end dates?
No. Basic subtraction returns elapsed days, so January 1 to January 10 is 9. To count all dates from January 1 through January 10, add one and get 10.
Can Excel count weekdays between two dates?
Yes. NETWORKDAYS counts weekdays between a start and end date, including working-day endpoints, and can take a range of holidays to exclude. Its default weekend is Saturday and Sunday.
Why is my days-between-dates formula negative?
The end date is earlier than the start date in the subtraction order. Switch the cell references if you want a positive duration, or keep the negative value if it meaningfully indicates a reversed interval.
Related
- How to Make a Copy of a Sheet in Excel
- Freeze Panes in Excel: Keep Rows and Columns Visible
- Find Duplicates in Excel: A Practical Step-by-Step Guide
Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.
More in Formulas & functions
- Excel Formula Between Two Dates: Count, Sum, or CheckIf dates are in A2:A100, the start date is in D1, and the end date is in E1,…
- Excel Function to Keep a Cell Constant in Formulas ExplainedTo keep a cell reference fixed when you copy an Excel formula, make it absolute by adding dollar…
- Excel Formula to Reference a Sheet Name from a CellTo reference a worksheet named in a cell, use Excel’s INDIRECT function. If A1 contains the sheet name…
- Sumifs with date range?Learn how SUMIFS handles dates, boundaries, months, extra criteria, and common errors, with clear Excel examples to help…
- COUNTIF in Excel: Count Empty Cells and Blank Cells EasilyIf your cells are in A2:A20, use =COUNTIF(A2:A20,"") to count empty cells. COUNTIF with an empty-string criterion counts…
- Excel Formula for Years Between Dates: Exact or DecimalFor completed years between two dates in Microsoft Excel, enter a start date in A2 and an end…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.