Excel Formula: Calculate overlapping days between two date ranges
In this tutorial, it provides a formula to calculate the overlapping days between two date ranges in Excel. For example, the first given date range is 1/1/2020-6/20/2020, and the project A is proceeded in the date range 8/16/2019-1/2/2020, there are 2 overlapping days between these two date ranges as above screenshot shown.
|End1, start1: the end date and start date in the first date range.|
|End 2, start2: the end date and start date in the second date range.|
The formula returns the overlapping days with a numeric value.
How this formula work
Here the projects are proceeded in different date ranges, we want to calculate the overlapping days between date range of each project and a given fixed date range in Range C2:C3.
In cell H3, please use below formula:
Press Enter key then drag autofill handle below to calculate the overlapping days.
MIN function is used to find the minimum value in many values. Here it finds out the earlier date between the two end dates.
MAX function is used to find the maximum value in values.
The inner MAX function finds out the later date between two start dates.
To include both start date and end date, we offset the result by adding 1.
The outer MAX function is used to display the negative value instead of zero.
- Calculate Overtime Pay
In this tutorial, it shows a timesheet to list the working hours, and provides a formula to calculate the overtime pay.
- Assign Points Based On Late Time
This tutorial provides a clear guide on how to use the IF function to assign points on late time in excel.
- Calculate Days Remaining Between Two Dates
Here, this tutorial provides a formula to quickly calculate the left days between two dates.
- Calculate Network Time With Break In A Timesheet
It provides the formula which uses the MOD function to calculate the network time with breaks in Excel.
- Excel IF Function
Test for specified conditions, then returns the corresponding values
- Excel VALUE Function
Convert text to number.
- Excel MONTH Function
The MONTH is used to get the month as integer number (1 to 12) from date.
- Excel DAY Function
DAY function gets the day as a number (1 to 31) from a date
- Excel YEAR Function
The YEAR function returns the year based on the given date in a 4-digit serial number format.