Go Back

Calculate date overlap in days

To effectively manage projects or activities we encounter a situation we need to determine how many days of project 1 fall into project 2. Using the same approach, we can also calculate how many days of a project date range (start date and end date) overlap with a specific date range (a given start and end date).

Figure 1. Calculation of Date Overlap in Days

Calculating Date Overlap in Days with Specific Date Range

When we have a list of projects’ date ranges and we want to see how many days of each project fall between a specific date range then we need to calculate date overlap in days. When we want to calculate the number of days between two dates then we simply subtract the start date from the end date, such as;

=End_Date - Start_Date +1

Note: To include both start date and end date, we offset the result by adding 1

Following the same rule, first we need to find out “End Date”, whichever is lower between two end dates, using the MIN function, and then we need to find out “Start Date”, whichever is higher between two start dates, using the MAX function. Finally, we subtract the “Start Date” from the earlier “End Date” in the following formula syntax;

=MAX(MIN(End1,End2)-MAX(Start1,Start2)+1,0)

Here, the outer MAX function is used to trap the negative value and returns zero instead. In our example, to calculate date overlap in days of each project’s date range with specific date range we need to apply the following formula in cell E2 and copy down to other cells in column E;

=MAX(MIN($H$3,D2)-MAX($H$2,C2)+1,0)

Figure 2. Calculating Date Overlap in Days with Specific Date Range

Calculating Date Overlap in Days Between Two Date Ranges

When we want to know how many days of one date range fall into another date range then we need to calculate date overlap in days between two date ranges or projects. Using the same approach, we will use the following formula in cell E3 to find out how many days of Project 1 fall into Project 2 and so on;

=MAX(MIN(D2,D3)-MAX(C2,C3)+1,0)

Copy down the formula to other cells.

Figure 3. Calculating Date Overlap in Days Between Two Date Ranges

Instant Connection to an Expert through our Excelchat Service

Most of the time, the problem you will need to solve will be more complex than a simple application of a formula or function. If you want to save hours of research and frustration, try our live Excelchat service! Our Excel Experts are available 24/7 to answer any Excel question you may have. We guarantee a connection within 30 seconds and a customized solution within 20 minutes.

Did this post not answer your question? Get a solution from connecting with the expert.

Another blog reader asked this question today on Excelchat:
Here are some problems that our users have asked and received explanations on

I'm using an array function to calculate the number of overlapping days in a vertical set of date ranges, but i want to separate the counting of overlapping days based on a value in column A of each row (i.e., still compare the date in a row to all of the other dates in the spreadsheet to see if there is overlap, but total the overlap in two sets based on the two possible values in column A). Alternatively, i could use an array function that gives overlap values by row and then use a sumif function, but only if i can figure out how to not double count overlapped days.
Solved by K. Q. in 30 mins
I am trying to find a formula that determines if date range A lies within date range B, then return how what days are in the range, followed by the start and end date. Example: - Date Range A = April 1 - April 30 - Date Range B = April 15 - Dec 31 Answer I need: - the start date of the range overlap is April 15 (Cell 2) - the end date of the range overlap is April 30 (Cell 3) - Number of days overlapping is 15. (Cell 1)
Solved by F. W. in 22 mins
I need a formula to calculate adding 5 business days to a date in another column.
Solved by S. H. in 30 mins

Leave a Comment

avatar