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:

DrLove73

New Member
Joined
Nov 4, 2015
Messages
7
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.
 

DrLove73

New Member
Joined
Nov 4, 2015
Messages
7
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
 

Forum statistics

Threads
1,082,300
Messages
5,364,387
Members
400,796
Latest member
vrcdesktop

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top