Formula to count number of days that match, when comparing one daterange to another

M

Mike C

I am trying to count any matching days when comparing one date range
to another. Any formula suggestions would be appreciated.

For example:

Range 1
Start Date1 Thru Date1 Start Date 2 Thru Date 2 Count Match
3/4/08 4/9/09 3/5/08 3/7/09
formula to show "3"
5/1/08 5/15/08 4/8/08 5/5/08 formula
to show "5"
Etc
 
T

T. Valko

Not sure how you arrive at a result of 3 for the first group. There are 368
days that overlap.

This formula returns 5 for the second group:

=MAX(0,MIN(B3,D3)-MAX(A3,C3)+1)
 
M

Mike C

Oops. I had the wrong year in the first row of sample dates.

Regardless, that is what i needed. Thanks again Biff.
 
T

T. Valko

Ok, good deal. Thanks for the feedbck!

--
Biff
Microsoft Excel MVP


Oops. I had the wrong year in the first row of sample dates.

Regardless, that is what i needed. Thanks again Biff.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top