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

NEW_IDOLD_ID_1OLD_ID_2OLD_ID_3OLD_ID_4
1112233
2666688
37777
444558899

<tbody>
</tbody>


OLD TABLE

IDVALUE
111
663
227
889
335
772
994
556
444
887

<tbody>
</tbody>

NEW TABLE
IDVALUE
110
212
313
42

<tbody>
</tbody>
ML6wWwR
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
The totals you show in NEW TABLE are not correct...

Row\Col
A​
B​
C​
D​
E​
F​
G​
H​
I​
J​
K​
1​
NEW_IDOLD_ID_1OLD_ID_2OLD_ID_3OLD_ID_4IDVALUEIDVALUE
2​
1
11
22
33
11
1
1
13
3​
2
66
66
88
66
3
2
22
4​
3
77
77
22
7
3
4
5​
4
44
55
88
99
88
9
4
30
6​
33
5
7​
77
2
8​
99
4
9​
55
6
10​
44
4
11​
88
7

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...

Row\Col
A​
B​
C​
D​
E​
F​
G​
H​
I​
J​
K​
1​
NEW_IDOLD_ID_1OLD_ID_2OLD_ID_3OLD_ID_4IDVALUEIDVALUE
2​
1
11
22
33
11
1
1
13
3​
2
66
66
88
66
3
2
22
4​
3
77
77
22
7
3
4
5​
4
44
55
88
99
88
9
4
30
6​
33
5
7​
77
2
8​
99
4
9​
55
6
10​
44
4
11​
88
7

<tbody>
</tbody>


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...

Row\Col
A​
B​
C​
D​
E​
F​
G​
H​
I​
J​
K​
1​
NEW_IDOLD_ID_1OLD_ID_2OLD_ID_3OLD_ID_4IDVALUEIDVALUE
2​
1
11
22
33
11
1
1
13
3​
2
66
66
88
66
3
2
22
4​
3
77
77
22
7
3
4
5​
4
44
55
88
99
88
9
4
30
6​
33
5
7​
77
2
8​
99
4
9​
55
6
10​
44
4
11​
88
7

<tbody>
</tbody>


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

NEW_IDOLD_ID_1OLD_ID_2OLD_ID_3OLD_ID_4
1112233
26688
377
444558899

<tbody>
</tbody>

OLD TABLE

IDITEM_NOVALUE
1111
1123
1137
2219
2225
2232
3314
3326
3334

<tbody>
</tbody>


NEW TABLE
IDITEM_NOVALUE
1114
1214
1313

<tbody>
</tbody>

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...

Row\Col
A​
B​
C​
D​
E​
G​
H​
I​
K​
L​
M​
N​
1​
NEW_IDOLD_ID_1OLD_ID_2OLD_ID_3OLD_ID_4IDITEM_NOVALUE
ITEM_NO
2​
1
11
22
33
11
1
1
ID
1
2
3
3​
2
66
88
11
2
3
1
14
14
13
4​
3
77
11
3
7
2
0
0
0
5​
4
44
55
88
99
22
1
9
3
0
0
0
6​
22
2
5
4
0
0
0
7​
22
3
2
8​
33
1
4
9​
33
2
6
10​
33
3
4

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...

Row\Col
A​
B​
C​
D​
E​
G​
H​
I​
K​
L​
M​
N​
1​
NEW_IDOLD_ID_1OLD_ID_2OLD_ID_3OLD_ID_4IDITEM_NOVALUE
ITEM_NO
2​
1
11
22
33
11
1
1
ID
1
2
3
3​
2
66
88
11
2
3
1
14
14
13
4​
3
77
11
3
7
2
0
0
0
5​
4
44
55
88
99
22
1
9
3
0
0
0
6​
22
2
5
4
0
0
0
7​
22
3
2
8​
33
1
4
9​
33
2
6
10​
33
3
4

<tbody>
</tbody>


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,216,180
Messages
6,129,340
Members
449,505
Latest member
Alan the procrastinator

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