Tracking overlap with a function

MiniFav

Board Regular
Joined
Mar 10, 2020
Messages
81
Office Version
  1. 365
Platform
  1. Windows
I am looking for an automatic way to identify overlap and still count totals acurately.
This might take a bit of explaining.

In the table below, Columns A,B and C show values 1 through to 50 group in data sets. The first row, I am looking at lines 1 through to 10 which is a total of 10 lines.

In Columns E,F,G and H show the same as column A,B and C except this time E3 (9) overlaps with Row F2 (10). So I have two data sets both looking at lines 9 and 10. I would like to see this overlap counted (Column H) and then subtracted from the total lines (G7).

Thing could get more complicated where in Columns J,K,L and M where the overlap happens in J9 meaning all row above up to and including row 2 now have overlapping lines.

Book1.xlsx
ABCDEFGHIJKLM
1Option 1Option 2TotalOption 1Option 2TotalOverlapOption 1Option 2TotalOverlap
211010110100110100
31120109201221120100
421301021301002130100
531401031401009404232
641501041501004150100
7TOTAL50TOTAL5250TOTAL8250
Sheet1
Cell Formulas
RangeFormula
C7,L7,G7C7=SUM(C2,C3,C5,C4,C6)


If the above makes sense and anyone have any suggestions for this using fomulas that would be fantastic.
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
What about something along these lines:

Excel Formula:
=IF((A2:A6<A1:A5)*(A2:A6>1),B2:B6-A2:A6+1,)
 
Upvote 0
Solution
What about something along these lines:

Excel Formula:
=IF((A2:A6<A1:A5)*(A2:A6>1),B2:B6-A2:A6+1,)
Thank you, amended slightly but that seems to be the solution!

Below is my table working if anyone in the future also needs it.

Book1.xlsx
ABCD
1Option 1Option 2TotalOverlap
2110104
372014
421301012
5194022
6415010
7TOTAL6616
8Total - overlap50
Sheet1
Cell Formulas
RangeFormula
D2:D6D2=IF((A3:A7<B2:B6)*(A3:A7>1),(B2:B6-A3:A7)+1,"")
D7D7=SUM(D2,D3,D4,D5,D6)
C2:C6C2=(B2-A2)+1
C7C7=SUM(C2,C3,C5,C4,C6)
C8C8=SUM(C2,C3,C5,C4,C6)-D7
Dynamic array formulas.
 
Upvote 0

Forum statistics

Threads
1,214,805
Messages
6,121,664
Members
449,045
Latest member
Marcus05

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top