Compare 2 item arrays if they overlap with other 2 item arrays in those two columns

DrLove73

New Member
Joined
Nov 4, 2015
Messages
7
Hi everyone. I am new on the forums so please point out any error I make in the process.

I work with Excell 2010 SP1 on Windows 7.

I need help with finding if any 2 horizontal sets of numbers next to each other overlap with other sets in same two columns. Numbers are cumulative times group of persons (each row represents separate group) needs to reach each stage of the path (represented by separate column).

Column H is the number I want to SUM for all rows that overlap, grouped by overlap/timeframe. This might be too complicated and if it is, then I think simple warning would be sufficient for now.

Group1 (Row 1) reaches end of stage C at 13,30 sec, and end of stage D at 14,51sec. So they are walking through stage D in that time frame, for (14,51 - 13,30 =) 1,21 sec. Now, Group2 also passes the same stage at the same time, and that is what I need to register.

What I need to know is if any other group will be at the same time in the same stage/column. If it does, like Group2 is, I need to SUM coresponding numbers from those two rows. This result should be shown in totally new table/sheet to allow for multiple matches, like for C2:D2 pair it can SUM(H1:H2) and show it in D1 (and C1, C2 and D2?) in other table/sheet.

Same goes for C4:D4 and C5:D5 pairs.

Similar situation where both pairs are not exact match but only overlap are E3:F3 and E4:F4 (many other overlap, but not all).

It should exclude matching that same pair, only other ones in those columns.

I do not mind VBA code, but automatic sheet/cell calculation would be best for interaction, experimentation.

Once I get those results, I will need to recalculate with added persons (increase in number of people in the given stage will increase/changes results given in this Example bellow, which will ripple through all consequent data/cells). But I can create another/next sheet with same formulas that produced this result but with corected data/number of people.

Here is example of data:

[TABLE="class: grid, width: 322, align: left"]
<tbody>[TR]
[TD="align: center"][/TD]
[TD="align: center"]A
[/TD]
[TD="align: center"]B
[/TD]
[TD="align: center"]C
[/TD]
[TD="align: center"]D
[/TD]
[TD="align: center"]E
[/TD]
[TD="align: center"]F
[/TD]
[TD="align: center"]G
[/TD]
[TD="align: center"]H
[/TD]
[/TR]
[TR]
[TD="align: center"]1
[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]13,30[/TD]
[TD="align: center"]14,51[/TD]
[TD="align: center"]18,22[/TD]
[TD="align: center"]21,97[/TD]
[TD="align: center"]23,72[/TD]
[TD="align: center"]6
[/TD]
[/TR]
[TR]
[TD="align: center"]2
[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]13,30[/TD]
[TD="align: center"]14,51[/TD]
[TD="align: center"]18,22[/TD]
[TD="align: center"]21,97[/TD]
[TD="align: center"]23,72[/TD]
[TD="align: center"]6
[/TD]
[/TR]
[TR]
[TD="align: center"]3
[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]10,50[/TD]
[TD="align: center"]11,71[/TD]
[TD="align: center"]15,42[/TD]
[TD="align: center"]19,17[/TD]
[TD="align: center"]20,92[/TD]
[TD="align: center"]8
[/TD]
[/TR]
[TR]
[TD="align: center"]4
[/TD]
[TD="align: center"]5,75[/TD]
[TD="align: center"]7,71[/TD]
[TD="align: center"]11,29[/TD]
[TD="align: center"]12,50[/TD]
[TD="align: center"]16,21[/TD]
[TD="align: center"]19,96[/TD]
[TD="align: center"]21,71[/TD]
[TD="align: center"]6
[/TD]
[/TR]
[TR]
[TD="align: center"]5
[/TD]
[TD="align: center"]5,75[/TD]
[TD="align: center"]7,71[/TD]
[TD="align: center"]11,29[/TD]
[TD="align: center"]12,50[/TD]
[TD="align: center"]16,21[/TD]
[TD="align: center"]19,96[/TD]
[TD="align: center"]21,71[/TD]
[TD="align: center"]5
[/TD]
[/TR]
[TR]
[TD="align: center"]6
[/TD]
[TD="align: center"]3,67[/TD]
[TD="align: center"]5,63[/TD]
[TD="align: center"]9,21[/TD]
[TD="align: center"]10,42[/TD]
[TD="align: center"]14,13[/TD]
[TD="align: center"]17,88[/TD]
[TD="align: center"]19,63[/TD]
[TD="align: center"]4
[/TD]
[/TR]
[TR]
[TD="align: center"]7
[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]1,96[/TD]
[TD="align: center"]5,54[/TD]
[TD="align: center"]6,75[/TD]
[TD="align: center"]10,46[/TD]
[TD="align: center"]14,21[/TD]
[TD="align: center"]15,96[/TD]
[TD="align: center"]6
[/TD]
[/TR]
[TR]
[TD="align: center"]8
[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]3,58[/TD]
[TD="align: center"]4,79[/TD]
[TD="align: center"]8,50[/TD]
[TD="align: center"]12,25[/TD]
[TD="align: center"]14,00[/TD]
[TD="align: center"]4
[/TD]
[/TR]
[TR]
[TD="align: center"]9
[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]3,71[/TD]
[TD="align: center"]7,46[/TD]
[TD="align: center"]9,21[/TD]
[TD="align: center"]8
[/TD]
[/TR]
[TR]
[TD="align: center"]10
[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]3,75[/TD]
[TD="align: center"]5,50[/TD]
[TD="align: center"]4
[/TD]
[/TR]
[TR]
[TD="align: center"]11
[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]1,75[/TD]
[TD="align: center"]6
[/TD]
[/TR]
</tbody>[/TABLE]
 
Last edited:

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Can someone at least provide me with formula to use a range but without a single cell? I think that is the hardest part of all, how to exclude once cell/pair from calculation.
 
Upvote 0
Ok, I solved one problem, I found out how to exclude cell from range:

Ok, I have solved it, I hope. For cell E4 ("$D4" reference) and range D2:D10 it's:

Code:
Code:
=IF(ROW(OFFSET($D4;0;0))=ROW($D$2);SUM(OFFSET($D4;1;0):$D$10);IF(ROW(OFFSET($D4;0;0))=ROW($D$10);SUM($D$2:OFFSET($D4;-1;0));SUM($D$2:OFFSET($D4;-1;0);OFFSET($D4;1;0):$D$10)))
or
Code:
=IF(ROW(OFFSET("cell to exclude";0;0))=ROW($D$2);SUM(OFFSET("cell to exclude";1;0):$D$10);IF(ROW(OFFSET("cell to exclude";0;0))=ROW($D$10);SUM($D$2:OFFSET("cell to exclude";-1;0));SUM($D$2:OFFSET("cell to exclude";-1;0);0
 
Upvote 0

Forum statistics

Threads
1,223,237
Messages
6,170,928
Members
452,366
Latest member
TePunaBloke

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