Calculate Difference of Dates in Microsoft Excel

Enter a date to calculate duration in years, months and days in Microsoft Excel
Enter a Date to Get Complete Duration Calculated in MS Excel

Here is the method to calculate past dates and how to calculate date difference till future date:

How to Calculate Past Dates, Future Dates, and Date Differences in Microsoft Excel

Microsoft Excel is a powerful tool that can be used to perform a variety of tasks, including calculating date differences and identifying past and future dates. There are two main methods for calculating date differences in Excel: using the DATEDIF function and subtracting dates directly.

Calculating Past Dates

To calculate the number of days, months, or years that have passed since a specific date, you can use the DATEDIF function along with the TODAY() function. The TODAY() function returns the current date, so you can subtract the start date from the current date to determine the elapsed time.

Formula: =DATEDIF(start_date_cell, TODAY(), "unit")

Parameters:

  • start_date_cell: The cell reference containing the start date
  • unit: The unit of time you want to calculate the difference in (Y for years, M for months, D for days, W for weeks)

Example:

To calculate the number of days that have passed since January 1, 2023, use the following formula: =DATEDIF(A1, TODAY(), "D")

This formula assumes that the start date is in cell A1.

Calculating Future Dates

To calculate the number of days, months, or years until a specific future date, you can subtract the current date from the future date.

Formula: =future_date_cell - TODAY()

Parameters:

  • future_date_cell: The cell reference containing the future date

Example:

To calculate the number of days until December 25, 2023, use the following formula: =B1 - TODAY()

This formula assumes that the future date is in cell B1.

Calculating Date Differences

To calculate the difference between two dates, you can subtract the earlier date from the later date.

Formula: =later_date_cell - earlier_date_cell

Parameters:

  • later_date_cell: The cell reference containing the later date
  • earlier_date_cell: The cell reference containing the earlier date

Example:

To calculate the number of days between October 4, 2023, and November 25, 2023, use the following formula: =B2 - A2

This formula assumes that the earlier date is in cell A2 and the later date is in cell B2.

Formatting Results

By default, Excel will format the result of the DATEDIF or subtraction formula as a number. However, you can format the result as a more readable format, such as years, months, or days. To do this, follow these steps:

  1. Select the cell that contains the result.
  2. Right-click the cell and select “Format Cells”.
  3. In the “Format Cells” dialog box, select the “Number” tab.
  4. In the “Category” list, select “Custom”.
  5. In the “Type” box, type the following format code:
  6. "Y" "years"
  7. Click “OK”.

This format code will display the result as a number of years. You can use the following format codes to display the result in other units of time:

  • Years: “Y”
  • Months: “M”
  • Days: “D”
  • Weeks: “W”

Conclusion

Excel provides versatile tools like the DATEDIF function and simple subtraction methods to calculate date differences, identify past dates, and determine the number of days until a future date. These calculations can be useful for various tasks, such as tracking project timelines, analyzing historical data, or planning future events.

You can also watch a video Tutorial in Urdu to understand practically how to calculate the difference of date in Microsoft Excel