As Seen on TechCrunch: Finofo Raises $1.65M CAD!

Excel Guide

Calculating the Number of Days Between Dates in Excel

Determining the difference in days between two dates is a frequent task within Excel. Several methods exist to achieve this, contingent upon the format of the dates. This guide illustrates how to compute the number of days between dates in Excel by utilizing the DATEDIF function.

The DATEDIF Function in Excel

The DATEDIF function, an intrinsic function in Excel, calculates the disparity in days, months, or years between two dates. This function is universally available across all Excel versions.

To employ the DATEDIF function, two arguments are necessary: the start date and the end date. The start date represents the initial date in the range for which the number of days is to be computed. The end date signifies the final date within that range. This function facilitates determining the days between any two dates, whether in separate cells or distinct worksheets.

Syntax of DATEDIF Function

The syntax for the DATEDIF function is structured as follows:

DATEDIF(start_date, end_date, unit)

The start_date and end_date parameters are obligatory. These can be textual date entries or cell references containing dates. The unit parameter is optional, designating the time unit for the difference calculation. Unit options include:

  • d: Days
  • m: Months
  • y: Years

If no unit is specified, the default remains as days.

Illustrative Examples

Here are practical examples demonstrating how to use the DATEDIF function:

  1. Computing Days Between Two Dates
  2. Formula: =DATEDIF(A1, A2, "d")
  3. Result: 9 days (between the start and end dates in cells A1 and A2).
  4. Calculating Months Between Dates
  5. Formula: =DATEDIF(A1, A2, "m")
  6. Result: 1 month (between the start and end dates in cells A1 and A2).
  7. Determining Years Between Dates
  8. Formula: =DATEDIF(A1, A2, "y")
  9. Result: 0 years (between the start and end dates in cells A1 and A2).

Get the Sample File

You can access a sample file showcasing the application of the DATEDIF function by downloading it from our website. This file includes various instances where the DATEDIF function is employed, allowing you to practice using it with your own data.