How to Calculate the Number of Days Between Two Dates in Excel

Explain how to calculate the number of days from a past date to today in Excel using date subtraction and the TODAY function, and clearly describe how to handle common problems such as incorrect result display, text dates, negative numbers, and blank rows.

Key points of this article

  • Subtracting two dates directly gives the number of days between them; Excel stores dates as serial numbers, so the formula result is a whole number of days.
  • To calculate the number of days from a past date to today, use =TODAY()-start date; TODAY changes with the date on which the file is opened.
  • If the result cell displays as a date or a string of numbers, change the format to General or Number; the calculation itself is not wrong.
  • To calculate in years, months, and days, or only working days, use DATEDIF and NETWORKDAYS respectively.

Many people record contract signing dates, loan dates, or project start dates in Excel and want to know "how many days have passed since then." The obvious approach is to subtract that date from today's date, but when you actually try it, you often run into results displayed as dates, #VALUE! errors, or a day count that changes every day.

This article is written for people who need to calculate date intervals in spreadsheets. After reading it, you will be able to use one or two formulas to work out the number of days from any past date to today, know when to use date subtraction, TODAY, DATEDIF, or NETWORKDAYS, and know where to check when the result is wrong.

How do I calculate the number of days from a past date to now in Excel? One-sentence answer

Use =TODAY()-A1 (where A1 holds the past date), or =DATEDIF(A1,TODAY(),"d") to get whole days only.

Enter =TODAY()-start date in an empty cell and press Enter to get the number of days, then change the format of the result cell to General or Number. The table below lists the common cases and how to handle them.

Your situationRecommended PracticesCause
Two fixed dates; I just want to know how many days apart they are.End date - start dateThe result is fixed and not affected by the opening date.
Calculate the number of days from a past date to today, and keep it updated at all times.=TODAY()-start dateTODAY returns the current date, and it recalculates (changes) every time the worksheet is recalculated.
Needs to be precise to the hour or minute.=NOW()-start timeNOW includes the time portion, and the result is a decimal number of days
How many years, months, and days does it come to?=DATEDIF(start_date,TODAY(),"y") etc.DATEDIF can return the complete years, complete months, and remaining days separately.
Count only weekdays, excluding weekends.=NETWORKDAYS(start date,TODAY())Automatically exclude Saturdays and Sundays, and allow specifying public holidays as well.

Before You Begin: Confirm These Points

Check the following items before you start, as this can prevent most incorrect results.

  • Check whether the cell really contains a date. In Excel, a date is essentially a numeric value and is usually right-aligned in the cell. If it is left-aligned, it is most likely text, and text cannot be used directly in subtraction. For example, "2024.3.1" looks like a date, but Excel may treat it as plain text.
  • The display format does not affect calculations. The same date can be shown as "2024/3/1" or as "45352", and the result of the calculation will be the same. Seeing a number instead only means the format has been set to General; it does not mean the formula is wrong.
  • TODAY changes over time. It returns the current date each time the workbook is opened or recalculated, so the same formula will give different results today and tomorrow. If you need to keep the number of days for a particular day, copy the result and use "Paste Special > Values" to fix it.
  • TODAY does not include a time, while NOW does. Use TODAY when you only want to count whole days; use NOW only when you need the exact time of day down to the minute.
  • Make sure the start date is earlier than the end date. If the start date is later than today, the subtraction result will be negative; DATEDIF returns an error when the start date is later than the end date.

Steps to Calculate the Number of Days from a Date to Today in Excel

Assume column A holds dates and column B is used to show the number of days. The following walks through the steps using the signing date of a 12-page contract as an example.

  1. Enter the start date in cell A2, for example the signing date, and make sure it is right-aligned in the cell.
  2. Select cell B2 and enter =TODAY()-A2.
  3. Press Enter and check the result in B2. If it displays in date format, select B2 and change the cell format to General or Number.
  4. Check whether the result is the whole number of days you expect; for example, if the start date was yesterday, the result should be 1.
  5. Drag the fill handle at the bottom-right corner of B2 down to copy the formula to other rows.
  6. If column A has blank rows, change the formula to =IF(A2="","",TODAY()-A2); blank rows will stay empty instead of showing a very large number.
  7. To split the period into years, months, and days, enter =DATEDIF(A2,TODAY(),"y") in C2 to get the whole years, then use "ym" to get the remaining months and "md" to get the remaining days.

Verify item by item after completion

After writing the formula, it is recommended to manually check a few rows before handing it over for others to use.

Inspection itemHow do you see it?What should I do if I have a problem?
Is the number of days an integer?Do the results contain decimal numbers?If the value includes a time, use =INT(TODAY()-A2) to round it down to whole days.
Does the result display as a date?Is the cell in date format or a serial number?Change the cell format to General or Number
Is the result negative?Is the start date later than the end date?Check the order in which dates are entered, or use the ABS function to convert negative values to positive.
Does #VALUE! appear?Is the date left-aligned, and is it text?Convert using DATEVALUE, or re-enter as a standard date
Do blank rows display the number of days?Is the result of a blank line a very large number?Calculate after using IF to check for blanks

📊 Core Comparison

Three commonly used calculation methods each have their own applicable scenarios; the table below can help you choose quickly.

MethodWriting ExamplesResult formatSuitable scenarios
Date subtraction=B2-A2Integer daysThe interval between two fixed dates
TODAY subtraction=TODAY()-A2Whole number of days, changes dailyCumulative number of days from a past date to today
DATEDIF=DATEDIF(A2,TODAY(),"y")Whole years, whole months, or remaining daysScenarios Requiring Splitting, Such as Contract Term, Years of Service, and Age

❓ Frequently Asked Questions (FAQ)

1. Why does my date subtraction result display as a string of dates?

This is a cell formatting issue. Excel sometimes applies a date format to the result of subtracting dates, so after you change the cell to General or Number, it displays the number of days.

2. Is the DATEDIF function still usable if it can't be found in the function list?

Yes. DATEDIF is a compatibility function retained in Excel. It may not appear in the autocomplete list, but you can still use it by typing the formula directly.

3. How do I count only weekdays, excluding weekends?

Use the NETWORKDAYS function, for example =NETWORKDAYS(A2,TODAY()). It excludes Saturdays and Sundays and includes both the start and end dates; if there are holidays, you can add a list of holiday dates as the third argument.

4. Why did the number of days I calculated yesterday change when I opened it today?

Because the formula uses TODAY, it returns a different date every day. When you need to fix the result, copy the formula result and paste it as values.

📝 Summary

To calculate the number of days from a past date until now in Excel, the common formula is =TODAY()-start date. If the result is wrong, first check whether the date is stored as text and whether the cell format is correct. If you need to split the result by years and months, use DATEDIF; if you only want to count workdays, use NETWORKDAYS.

Open OmniDoc and process your spreadsheet file

Updated 2026-11-29