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:

A
B
C
D
E
F
G
H
1
0013,3014,5118,2221,9723,726
2
0013,3014,5118,2221,9723,726
3
0010,5011,7115,4219,1720,928
4
5,757,7111,2912,5016,2119,9621,716
5
5,757,7111,2912,5016,2119,9621,715
6
3,675,639,2110,4214,1317,8819,634
7
01,965,546,7510,4614,2115,966
8
003,584,798,5012,2514,004
9
00003,717,469,218
10
000003,755,504
11
0000001,756

<tbody>
</tbody>
 
Last edited:

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
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,214,832
Messages
6,121,841
Members
449,051
Latest member
excelquestion515

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