View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Daniel.M Daniel.M is offline
external usenet poster
 
Posts: 32
Default Calculating date overlapping

Hi Salam,

=IF(OR(IDate2<RDate1,IDate1RDate2),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.

"Chip Pearson" wrote in message
...
Salam,

See http://www.cpearson.com/excel/DateIntervals.htm for some
example formulas.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Salam" wrote in message
...
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