Calculating date overlapping

  • Thread starter Thread starter Salam
  • Start date Start date
S

Salam

If I have two group of dates and need to calculate the
ovelapping period;
i.e
group 1 start date 12/12/2003 and finish date 1/May/2004
group 2 start date 1/1/2004 and finish date is 1/Feb/2004
so the overlapping is from 1/1/2004 until 1/Feb/2004
 
Hi Salam,
=IF(OR(IDate2<RDate1,IDate1>RDate2),0,
(MIN(IDate2,RDate2)-MAX(IDate1,RDate1)+1))

Another way (of removing negative results):

=MAX(0,1+MIN(IDate2,RDate2)-MAX(IDate1,RDate1))

Regards,

Daniel M.
 
Back
Top