Hi,
I am trying to solve this problem but not able to get the right results. Any help will be greatly appreciated.

I have a table with multiple columns and around 200 rows. The first column is Start Date and second column is End Date. What I need to find is the sum of the durations without counting the overlapping days twice. Example table is:

Start Date | End Date | Duration (including start day)
01/6/15 | 01/10/15 | 5
01/13/15 | 01/20/15 | 8
01/12/15 | 01/22/15 | 11
01/18/15 | 01/25/15 | 8

Sum of Duration is 32. But what I want is the sum counting overlapping days only once. This should be equal to 19 Days in this example.

Also I need to be able filter the table and the formula should only include visible rows in its calculation (ignore filtered rows while calculating sum of days).