Creating new table

mmiklauz

New Member
Joined
Jul 31, 2017
Messages
5
Hi everyone!

I have a problem and I can't figure out how to solve it, so I would appreciate any help.

1. I need to check each row in OLD TABLE, look into HELP TABLE for NEW_ID (if exists) and create new ID in NEW TABLE
2. Then I need sum all values that belong to NEW_ID and insert into NEW TABLE with NEW_ID


HELP TABLE

[TABLE="width: 200"]
<tbody>[TR]
[TD]NEW_ID[/TD]
[TD]OLD_ID_1[/TD]
[TD]OLD_ID_2[/TD]
[TD]OLD_ID_3[/TD]
[TD]OLD_ID_4[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]11[/TD]
[TD]22[/TD]
[TD]33[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]66[/TD]
[TD]66[/TD]
[TD]88[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]77[/TD]
[TD]77[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]44[/TD]
[TD]55[/TD]
[TD]88[/TD]
[TD]99[/TD]
[/TR]
</tbody>[/TABLE]


OLD TABLE

[TABLE="width: 200"]
<tbody>[TR]
[TD]ID[/TD]
[TD]VALUE[/TD]
[/TR]
[TR]
[TD]11[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]66[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]22[/TD]
[TD]7[/TD]
[/TR]
[TR]
[TD]88[/TD]
[TD]9[/TD]
[/TR]
[TR]
[TD]33[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]77[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]99[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]55[/TD]
[TD]6[/TD]
[/TR]
[TR]
[TD]44[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]88[/TD]
[TD]7[/TD]
[/TR]
</tbody>[/TABLE]

NEW TABLE
[TABLE="width: 200"]
<tbody>[TR]
[TD]ID[/TD]
[TD]VALUE[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]10[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]12[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]13[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]2[/TD]
[/TR]
</tbody>[/TABLE]
ML6wWwR
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
The totals you show in NEW TABLE are not correct...

[Table="width:, class:grid"][tr][td]Row\Col[/td][td]
A​
[/td][td]
B​
[/td][td]
C​
[/td][td]
D​
[/td][td]
E​
[/td][td]
F​
[/td][td]
G​
[/td][td]
H​
[/td][td]
I​
[/td][td]
J​
[/td][td]
K​
[/td][/tr][tr][td]
1​
[/td][td]NEW_ID[/td][td]OLD_ID_1[/td][td]OLD_ID_2[/td][td]OLD_ID_3[/td][td]OLD_ID_4[/td][td][/td][td]ID[/td][td]VALUE[/td][td][/td][td]ID[/td][td]VALUE[/td][/tr]
[tr][td]
2​
[/td][td]
1
[/td][td]
11
[/td][td]
22
[/td][td]
33
[/td][td][/td][td][/td][td]
11
[/td][td]
1
[/td][td][/td][td]
1
[/td][td]
13
[/td][/tr]
[tr][td]
3​
[/td][td]
2
[/td][td]
66
[/td][td]
66
[/td][td]
88
[/td][td][/td][td][/td][td]
66
[/td][td]
3
[/td][td][/td][td]
2
[/td][td]
22
[/td][/tr]
[tr][td]
4​
[/td][td]
3
[/td][td]
77
[/td][td]
77
[/td][td][/td][td][/td][td][/td][td]
22
[/td][td]
7
[/td][td][/td][td]
3
[/td][td]
4
[/td][/tr]
[tr][td]
5​
[/td][td]
4
[/td][td]
44
[/td][td]
55
[/td][td]
88
[/td][td]
99
[/td][td][/td][td]
88
[/td][td]
9
[/td][td][/td][td]
4
[/td][td]
30
[/td][/tr]
[tr][td]
6​
[/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][td]
33
[/td][td]
5
[/td][td][/td][td][/td][td][/td][/tr]
[tr][td]
7​
[/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][td]
77
[/td][td]
2
[/td][td][/td][td][/td][td][/td][/tr]
[tr][td]
8​
[/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][td]
99
[/td][td]
4
[/td][td][/td][td][/td][td][/td][/tr]
[tr][td]
9​
[/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][td]
55
[/td][td]
6
[/td][td][/td][td][/td][td][/td][/tr]
[tr][td]
10​
[/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][td]
44
[/td][td]
4
[/td][td][/td][td][/td][td][/td][/tr]
[tr][td]
11​
[/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][td]
88
[/td][td]
7
[/td][td][/td][td][/td][td][/td][/tr]
[/table]


In J2 control+shift+enter, not just enter, and copy down:
Rich (BB code):
=IF(ROWS($J$2:J2)>COUNT($A$2:$A$5),"",INDEX($A$2:$A$5,
    SMALL(IF(FREQUENCY(IF(ISNUMBER($A$2:$A$5),IF(COUNTIFS($G$2:$G$11,$B$2:$E$5),
    MATCH($A$2:$A$5,$A$2:$A$5,0))),ROW($A$2:$A$5)-ROW($A$2)+1),ROW($A$2:$A$5)-ROW($A$2)+1),ROWS($J$2:J2))))

In K2 control+shift+enter, not just enter, and copy down:
Rich (BB code):
=SUM(SUMIFS($H$2:$H$11,$G$2:$G$11,INDEX($B$2:$E$5,MATCH($J2,$A$2:$A$5,0),0)))
 
Upvote 0
The totals you show in NEW TABLE are not correct...

[TABLE="class: grid"]
<tbody>[TR]
[TD]Row\Col[/TD]
[TD]
A​
[/TD]
[TD]
B​
[/TD]
[TD]
C​
[/TD]
[TD]
D​
[/TD]
[TD]
E​
[/TD]
[TD]
F​
[/TD]
[TD]
G​
[/TD]
[TD]
H​
[/TD]
[TD]
I​
[/TD]
[TD]
J​
[/TD]
[TD]
K​
[/TD]
[/TR]
[TR]
[TD]
1​
[/TD]
[TD]NEW_ID[/TD]
[TD]OLD_ID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]
[TR]
[TD]
8​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]
99
[/TD]
[TD]
4
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
9​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]
55
[/TD]
[TD]
6
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
10​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]
44
[/TD]
[TD]
4
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
11​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]
88
[/TD]
[TD]
7
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


In J2 control+shift+enter, not just enter, and copy down:
Rich (BB code):
=IF(ROWS($J$2:J2)>COUNT($A$2:$A$5),"",INDEX($A$2:$A$5,
    SMALL(IF(FREQUENCY(IF(ISNUMBER($A$2:$A$5),IF(COUNTIFS($G$2:$G$11,$B$2:$E$5),
    MATCH($A$2:$A$5,$A$2:$A$5,0))),ROW($A$2:$A$5)-ROW($A$2)+1),ROW($A$2:$A$5)-ROW($A$2)+1),ROWS($J$2:J2))))

In K2 control+shift+enter, not just enter, and copy down:
Rich (BB code):
=SUM(SUMIFS($H$2:$H$11,$G$2:$G$11,INDEX($B$2:$E$5,MATCH($J2,$A$2:$A$5,0),0)))

Thank you!! That works great!!
 
Upvote 0
The totals you show in NEW TABLE are not correct...

[TABLE="class: grid"]
<tbody>[TR]
[TD]Row\Col[/TD]
[TD]
A​
[/TD]
[TD]
B​
[/TD]
[TD]
C​
[/TD]
[TD]
D​
[/TD]
[TD]
E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D][/TD]
[/TR]
[TR]
[TD]
7​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]
77
[/TD]
[TD]
2
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
8​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]
99
[/TD]
[TD]
4
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
9​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]
55
[/TD]
[TD]
6
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
10​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]
44
[/TD]
[TD]
4
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
11​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]
88
[/TD]
[TD]
7
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


In J2 control+shift+enter, not just enter, and copy down:
Rich (BB code):
=IF(ROWS($J$2:J2)>COUNT($A$2:$A$5),"",INDEX($A$2:$A$5,
    SMALL(IF(FREQUENCY(IF(ISNUMBER($A$2:$A$5),IF(COUNTIFS($G$2:$G$11,$B$2:$E$5),
    MATCH($A$2:$A$5,$A$2:$A$5,0))),ROW($A$2:$A$5)-ROW($A$2)+1),ROW($A$2:$A$5)-ROW($A$2)+1),ROWS($J$2:J2))))

In K2 control+shift+enter, not just enter, and copy down:
Rich (BB code):
=SUM(SUMIFS($H$2:$H$11,$G$2:$G$11,INDEX($B$2:$E$5,MATCH($J2,$A$2:$A$5,0),0)))

One more question..how can I change the formula to do the following:

HELP TABLE

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]NEW_ID[/TD]
[TD]OLD_ID_1[/TD]
[TD]OLD_ID_2[/TD]
[TD]OLD_ID_3[/TD]
[TD]OLD_ID_4[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]11[/TD]
[TD]22[/TD]
[TD]33[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]66[/TD]
[TD]88[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]77[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]44[/TD]
[TD]55[/TD]
[TD]88[/TD]
[TD]99[/TD]
[/TR]
</tbody>[/TABLE]

OLD TABLE

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]ID[/TD]
[TD]ITEM_NO[/TD]
[TD]VALUE[/TD]
[/TR]
[TR]
[TD]11[/TD]
[TD]1[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]11[/TD]
[TD]2[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]11[/TD]
[TD]3[/TD]
[TD]7[/TD]
[/TR]
[TR]
[TD]22[/TD]
[TD]1[/TD]
[TD]9[/TD]
[/TR]
[TR]
[TD]22[/TD]
[TD]2[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]22[/TD]
[TD]3[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]33[/TD]
[TD]1[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]33[/TD]
[TD]2[/TD]
[TD]6[/TD]
[/TR]
[TR]
[TD]33[/TD]
[TD]3[/TD]
[TD]4[/TD]
[/TR]
</tbody>[/TABLE]


NEW TABLE
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]ID[/TD]
[TD]ITEM_NO[/TD]
[TD]VALUE[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]1[/TD]
[TD]14[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]2[/TD]
[TD]14[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]3[/TD]
[TD]13[/TD]
[/TR]
</tbody>[/TABLE]

Thank you in advance!
 
Upvote 0
@mmiklauz

Please do not post the same question multiple times.
Note that sometimes posts from new users require Moderator approval before you can see them on the public forums. When this happens, you should see a message to that effect when you try to post it.
Please be patient and do not attempt to post the question again.

I have removed your duplicate post
 
Upvote 0
One more question..how can I change the formula to do the following:

[...]

The output representation you have is not viable. In what follows I use a matrix representation...

[Table="width:, class:grid"][tr][td]Row\Col[/td][td]
A​
[/td][td]
B​
[/td][td]
C​
[/td][td]
D​
[/td][td]
E​
[/td][td]
G​
[/td][td]
H​
[/td][td]
I​
[/td][td]
K​
[/td][td]
L​
[/td][td]
M​
[/td][td]
N​
[/td][/tr][tr][td]
1​
[/td][td]NEW_ID[/td][td]OLD_ID_1[/td][td]OLD_ID_2[/td][td]OLD_ID_3[/td][td]OLD_ID_4[/td][td]ID[/td][td]ITEM_NO[/td][td]VALUE[/td][td][/td][td]
ITEM_NO
[/td][td]
[/td][td]
[/td][/tr]
[tr][td]
2​
[/td][td]
1
[/td][td]
11
[/td][td]
22
[/td][td]
33
[/td][td][/td][td]
11
[/td][td]
1
[/td][td]
1
[/td][td]ID[/td][td]
1
[/td][td]
2
[/td][td]
3
[/td][/tr]
[tr][td]
3​
[/td][td]
2
[/td][td]
66
[/td][td]
88
[/td][td][/td][td][/td][td]
11
[/td][td]
2
[/td][td]
3
[/td][td]
1
[/td][td]
14
[/td][td]
14
[/td][td]
13
[/td][/tr]
[tr][td]
4​
[/td][td]
3
[/td][td]
77
[/td][td][/td][td][/td][td][/td][td]
11
[/td][td]
3
[/td][td]
7
[/td][td]
2
[/td][td]
0
[/td][td]
0
[/td][td]
0
[/td][/tr]
[tr][td]
5​
[/td][td]
4
[/td][td]
44
[/td][td]
55
[/td][td]
88
[/td][td]
99
[/td][td]
22
[/td][td]
1
[/td][td]
9
[/td][td]
3
[/td][td]
0
[/td][td]
0
[/td][td]
0
[/td][/tr]
[tr][td]
6​
[/td][td][/td][td][/td][td][/td][td][/td][td][/td][td]
22
[/td][td]
2
[/td][td]
5
[/td][td]
4
[/td][td]
0
[/td][td]
0
[/td][td]
0
[/td][/tr]
[tr][td]
7​
[/td][td][/td][td][/td][td][/td][td][/td][td][/td][td]
22
[/td][td]
3
[/td][td]
2
[/td][td][/td][td][/td][td][/td][td][/td][/tr]
[tr][td]
8​
[/td][td][/td][td][/td][td][/td][td][/td][td][/td][td]
33
[/td][td]
1
[/td][td]
4
[/td][td][/td][td][/td][td][/td][td][/td][/tr]
[tr][td]
9​
[/td][td][/td][td][/td][td][/td][td][/td][td][/td][td]
33
[/td][td]
2
[/td][td]
6
[/td][td][/td][td][/td][td][/td][td][/td][/tr]
[tr][td]
10​
[/td][td][/td][td][/td][td][/td][td][/td][td][/td][td]
33
[/td][td]
3
[/td][td]
4
[/td][td][/td][td][/td][td][/td][td][/td][/tr]
[/table]


In K3 control+shift+enter, not just enter, and copy down:
Rich (BB code):
=IF(ROWS($K$3:K3)>COUNT($A$2:$A$5),"",INDEX($A$2:$A$5,SMALL(IF(FREQUENCY(IF(ISNUMBER($A$2:$A$5),
    MATCH($A$2:$A$5,$A$2:$A$5,0)),ROW($A$2:$A$5)-ROW($A$2)+1),ROW($A$2:$A$5)-ROW($A$2)+1),ROWS($K$3:K3))))

In L2 control+shift+enter, not just enter, and copy across:
Rich (BB code):
=IFERROR(INDEX($H$2:$H$10,SMALL(IF(FREQUENCY(IF(ISNUMBER($H$2:$H$10),MATCH($H$2:$H$10,$H$2:$H$10,0)),
    ROW($H$2:$H$10)-ROW($H$2)+1),ROW($H$2:$H$10)-ROW($H$2)+1),COLUMNS($L$2:L2))),"")

In L3 control+shift+enter, not just enter, copy across, and down:
Rich (BB code):
=SUM(SUMIFS($I$2:$I$10,$G$2:$G$10,IF($A$2:$A$5=$K3,$B$2:$E$5),$H$2:$H$10,L$2))
 
Upvote 0
The output representation you have is not viable. In what follows I use a matrix representation...

[TABLE="class: grid"]
<tbody>[TR]
[TD]Row\Col[/TD]
[TD]
A​
[/TD]
[TD]
B​
[/TD]
[TD]
C​
[/TD]
[TD]
D​
[/TD]
[TD]
E​
[/TD]
[TD]
G​
[/TD]
[TD]
H​
[/TD]
[TD]
I​
[/TD]
[TD]
K​
[/TD]
[TD]
L​
[/TD]
[TD]
M​
[/TD]
[TD]
N​
[/TD]
[/TR]
[TR]
[TD]
1​
[/TD]
[TD]NEW_ID[/TD]
[TD]OLD_ID_1[/TD]
[TD]OLD_ID_2[/TD]
[TD]OLD_ID_3[/TD]
[TD]OLD_ID_4[/TD]
[TD]ID[/TD]
[TD]ITEM_NO[/TD]
[TD]VALUE[/TD]
[TD][/TD]
[TD]
ITEM_NO
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
2​
[/TD]
[TD]
1
[/TD]
[TD]
11
[/TD]
[TD]
22
[/TD]
[TD]
33
[/TD]
[TD][/TD]
[TD]
11
[/TD]
[TD]
1
[/TD]
[TD]
1
[/TD]
[TD]ID[/TD]
[TD]
1
[/TD]
[TD]
2
[/TD]
[TD]
3
[/TD]
[/TR]
[TR]
[TD]
3​
[/TD]
[TD]
2
[/TD]
[TD]
66
[/TD]
[TD]
88
[/TD]
[TD][/TD]
[TD][/TD]
[TD]
11
[/TD]
[TD]
2
[/TD]
[TD]
3
[/TD]
[TD]
1
[/TD]
[TD]
14
[/TD]
[TD]
14
[/TD]
[TD]
13
[/TD]
[/TR]
[TR]
[TD]
4​
[/TD]
[TD]
3
[/TD]
[TD]
77
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]
11
[/TD]
[TD]
3
[/TD]
[TD]
7
[/TD]
[TD]
2
[/TD]
[TD]
0
[/TD]
[TD]
0
[/TD]
[TD]
0
[/TD]
[/TR]
[TR]
[TD]
5​
[/TD]
[TD]
4
[/TD]
[TD]
44
[/TD]
[TD]
55
[/TD]
[TD]
88
[/TD]
[TD]
99
[/TD]
[TD]
22
[/TD]
[TD]
1
[/TD]
[TD]
9
[/TD]
[TD]
3
[/TD]
[TD]
0
[/TD]
[TD]
0
[/TD]
[TD]
0
[/TD]
[/TR]
[TR]
[TD]
6​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]
22
[/TD]
[TD]
2
[/TD]
[TD]
5
[/TD]
[TD]
4
[/TD]
[TD]
0
[/TD]
[TD]
0
[/TD]
[TD]
0
[/TD]
[/TR]
[TR]
[TD]
7​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]
22
[/TD]
[TD]
3
[/TD]
[TD]
2
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
8​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]
33
[/TD]
[TD]
1
[/TD]
[TD]
4
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
9​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]
33
[/TD]
[TD]
2
[/TD]
[TD]
6
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
10​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]
33
[/TD]
[TD]
3
[/TD]
[TD]
4
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


In K3 control+shift+enter, not just enter, and copy down:
Rich (BB code):
=IF(ROWS($K$3:K3)>COUNT($A$2:$A$5),"",INDEX($A$2:$A$5,SMALL(IF(FREQUENCY(IF(ISNUMBER($A$2:$A$5),
    MATCH($A$2:$A$5,$A$2:$A$5,0)),ROW($A$2:$A$5)-ROW($A$2)+1),ROW($A$2:$A$5)-ROW($A$2)+1),ROWS($K$3:K3))))

In L2 control+shift+enter, not just enter, and copy across:
Rich (BB code):
=IFERROR(INDEX($H$2:$H$10,SMALL(IF(FREQUENCY(IF(ISNUMBER($H$2:$H$10),MATCH($H$2:$H$10,$H$2:$H$10,0)),
    ROW($H$2:$H$10)-ROW($H$2)+1),ROW($H$2:$H$10)-ROW($H$2)+1),COLUMNS($L$2:L2))),"")

In L3 control+shift+enter, not just enter, copy across, and down:
Rich (BB code):
=SUM(SUMIFS($I$2:$I$10,$G$2:$G$10,IF($A$2:$A$5=$K3,$B$2:$E$5),$H$2:$H$10,L$2))

Thank you, this will help me!
 
Upvote 0

Forum statistics

Threads
1,223,246
Messages
6,170,996
Members
452,373
Latest member
TimReeks

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