The attached Excel sheet should be self-explanatory I hope!
I have a fixed date range, "F" (A3:B3) and a number of variable date ranges ("V") in columns D and E.
I want column F to return the number of days between D and E that fall within range F All 6 possible examples are listed-
(i) V starts and ends before F = 0 days
(ii) V starts before range F and ends within F = some of F
(iii) V starts before before F and ends after F = all of F
(iv) V starts within F and ends within F = some of F
(v) V starts within F and ends after F = some of F
(vi) V starts after F and ends after F = 0 days
Just would like the elegant way to calculate this without using a nested IF for all 6 permutations