Hello.

I have three sets of dates indicating prior insurance coverage (most recent listed first):

Coverage 1 Start
Coverage 1 End
Coverage 2 Start
Coverage 2 End
Coverage 3 Start
Coverage 3 End

I need to calculate the total days coveraged for each range (e.g. Total Days for Coverage 1, Total Days for Coverage 2). But I need to count any overlapping days as 1 day.

If coverage 2 extends into coverage 1, then for coverage 1 I will only need to know the number of days after Coverage 2 ends

For example (All dates are inclusive):

Coverage 1 Start 5/1/11
Coverage 1 End 8/31/11
Coverage 2 Start 3/1/11
Coverage 2 End 6/30/11

Coverage 1 Total is 111
Coverage 2 Total is 122
Total between the two is 172
But I want Coverage 1 ( after accounting for overlap to be 50


I hope I explained that well and appreciate any help.

Mark