How to Calculate the Difference Between Two Dates in Excel

How to Calculate the Difference Between Two Dates in Excel: Complete Guide

Quick answer: If cell A2 contains the start date and B2 contains the end date, =B2-A2 returns the elapsed number of days in a normal Excel date system. For other needs, use DAYS, DATEDIF or NETWORKDAYS.

If you only need a quick web calculation, use our Date Time Difference Calculator. The methods below are useful when the calculation needs to remain inside an Excel workbook.

Method 1: Subtract One Date From Another

With a start date in A2 and an end date in B2, enter:

=B2-A2

If A2 is October 1, 2026 and B2 is October 11, 2026, the result is 10 elapsed days. If Excel displays another date instead of a number, change the result cell’s format to General or Number.

Method 2: Use the DAYS Function

The DAYS function makes the intent explicit:

=DAYS(B2,A2)

The first argument is the end date and the second is the start date.

Method 3: Calculate Complete Years, Months or Days With DATEDIF

DATEDIF can calculate completed units between two dates:

  • =DATEDIF(A2,B2,”Y”) — completed years
  • =DATEDIF(A2,B2,”M”) — completed months
  • =DATEDIF(A2,B2,”D”) — days

For an age-like display of completed years, remaining months and remaining days, combine separate DATEDIF calculations. Be careful with end-of-month dates because calendar months have different lengths.

Method 4: Count Working Days

For Monday-Friday working days, use:

=NETWORKDAYS(A2,B2)

To exclude holidays stored in E2:E10:

=NETWORKDAYS(A2,B2,E2:E10)

For a non-standard weekend, use NETWORKDAYS.INTL. See our working-days guide for endpoint, holiday and weekend considerations.

Dates and Times in the Same Cells

Excel stores times as fractions of a day, so subtracting two date-time values can return a decimal. For example, 1.5 means one day and 12 hours. Multiply the difference by 24 for hours, by 1,440 for minutes or by 86,400 for seconds.

Common Excel Date Problems

The formula returns #VALUE!

One or both “dates” may actually be text. Confirm that Excel recognizes the cells as real date values.

The result looks like a date

Format the result as General or Number instead of Date.

The result is negative

The end date may be earlier than the start date. If you intentionally want an unsigned difference, use ABS around a simple subtraction, but first make sure reversing the dates is logically appropriate.

Which Excel Formula Should You Use?

GoalMethod
Elapsed days=B2-A2 or DAYS
Completed years/monthsDATEDIF
Business daysNETWORKDAYS
Custom weekendsNETWORKDAYS.INTL
Hours between date-times=(B2-A2)*24

Last reviewed: October 2026. Excel function availability and interface labels can vary by version.

Share this article:

On This Page

Subscribe to our newsletter

Read the latest articles from our experts

Related Posts

time-to-decimal

Time to Decimal Conversion (Complete Guide + Calculator)

Learn how to convert hours and minutes into decimal hours using simple formulas, practical examples, and a reliable time to decimal calculator. This complete guide explains manual calculations, Excel formulas, common mistakes, payroll applications, and expert tips to help you perform accurate time conversion to decimal every time.

Pair of high-rise bootcut jeans worn by a woman.

How to Change Text Case in Excel: UPPER, LOWER, PROPER and More

Changing text case in Excel is easy when you know the right method. This guide explains how to use UPPER, LOWER, PROPER, Flash Fill, Power Query, and other practical techniques to clean names, titles, emails, product data, and spreadsheet text quickly and accurately.

How to Add Data Beginner Guide for All Platforms

How to Add Data Beginner Guide for All Platforms

Learn this add data guide with simple step by step methods for all platforms This beginner friendly article explains how to add data accurately in spreadsheets forms apps and websites while avoiding common mistakes and using helpful free tools to organize information more efficiently for personal academic and business use

How to Check Screen Time on Any Device Complete Guide

How to Check Screen Time on iPhone, Android, Windows and Mac

Learn how to check screen time on any device with this complete guide Understand phone screen time tracking, how to view screen time on Android iPhone and computers, and how to manage usage effectively using simple steps and helpful tools to improve productivity and digital well being

Online Age Calculator – Calculate Your Exact Age Instantly

Online Age Calculator – Calculate Your Exact Age Instantly

Discover how an online age calculator helps you calculate your exact age instantly. Learn how to use this free tool, understand chronological age, and explore advanced features. Try it now and get accurate results in seconds.

How to Calculate Working Days Only: Excluding Weekends and Holidays

How to Calculate Working Days Between Two Dates

Calculating working days requires subtracting two dates and then removing Saturdays, Sundays, and public holidays. This guide explains the exact method, from basic date difference to full business day calculation, with practical examples for project planning, invoicing, and deadline management.

Tools & Resources

Explore our collection of professional tools designed to streamline your workflow

Report a Bug