try.
Excel 2010[TABLE="class: grid, width: 300"]
<tbody>[TR="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]
[TD][/TD]
[TD]A
[/TD]
[TD]B
[/TD]
[TD]C
[/TD]
[/TR]
[TR]
[TD="align: center"]1
[/TD]
[TD]item num
[/TD]
[TD]location
[/TD]
[TD]onhand
[/TD]
[/TR]
[TR]
[TD="align: center"]2
[/TD]
[TD]AMP-RBLM
[/TD]
[TD]BGB21
[/TD]
[TD="align: right"]448
[/TD]
[/TR]
[TR]
[TD="align: center"]3
[/TD]
[TD]AMP-RBLM
[/TD]
[TD]WF5000
[/TD]
[TD="align: right"]1040
[/TD]
[/TR]
[TR]
[TD="align: center"]4
[/TD]
[TD]AMP-VHB1P
[/TD]
[TD]WITOP
[/TD]
[TD="align: right"]620
[/TD]
[/TR]
[TR]
[TD="align: center"]5
[/TD]
[TD]B011-PP
[/TD]
[TD]WA2301
[/TD]
[TD="align: right"]46
[/TD]
[/TR]
[TR]
[TD="align: center"]6
[/TD]
[TD]B011-PP
[/TD]
[TD]WA2304
[/TD]
[TD="align: right"]1774
[/TD]
[/TR]
[TR]
[TD="align: center"]7
[/TD]
[TD]B011-6-CRP
[/TD]
[TD]BGA23
[/TD]
[TD="align: right"]2490
[/TD]
[/TR]
[TR]
[TD="align: center"]8
[/TD]
[TD]B011-6-CRP
[/TD]
[TD]ST01
[/TD]
[TD="align: right"]-2429
[/TD]
[/TR]
[TR]
[TD="align: center"]9
[/TD]
[TD]B011-6-CRP
[/TD]
[TD]WA2301
[/TD]
[TD="align: right"]3500
[/TD]
[/TR]
[TR]
[TD="align: center"]10
[/TD]
[TD]B011-6-8NSP
[/TD]
[TD]BGA23
[/TD]
[TD="align: right"]1000
[/TD]
[/TR]
</tbody>[/TABLE]
Sheet1
Excel 2010[TABLE="class: grid, width: 700"]
<tbody>[TR="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]
[TH][/TH]
[TH]A
[/TH]
[TH]B
[/TH]
[TH]C
[/TH]
[TH]D
[/TH]
[TH]E
[/TH]
[TH]F
[/TH]
[TH]G
[/TH]
[TH]H
[/TH]
[/TR]
[TR]
[TD="align: center"]1
[/TD]
[TD]item num
[/TD]
[TD]location1
[/TD]
[TD]onhand1
[/TD]
[TD]location2
[/TD]
[TD]onhand2
[/TD]
[TD]location3
[/TD]
[TD]onhand3
[/TD]
[TD]total available
[/TD]
[/TR]
[TR]
[TD="align: center"]2
[/TD]
[TD]AMP-RBLM
[/TD]
[TD]BGB21
[/TD]
[TD="align: right"]448
[/TD]
[TD]WF5000
[/TD]
[TD="align: right"]1040
[/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]1488
[/TD]
[/TR]
[TR]
[TD="align: center"]3
[/TD]
[TD]AMP-VHB1P
[/TD]
[TD]WITOP
[/TD]
[TD="align: right"]620
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]620
[/TD]
[/TR]
[TR]
[TD="align: center"]4
[/TD]
[TD]B011-PP
[/TD]
[TD]WA2301
[/TD]
[TD="align: right"]46
[/TD]
[TD]WA2304
[/TD]
[TD="align: right"]1774
[/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]1820
[/TD]
[/TR]
[TR]
[TD="align: center"]5
[/TD]
[TD]B011-6-CRP
[/TD]
[TD]BGA23
[/TD]
[TD="align: right"]2490
[/TD]
[TD]ST01
[/TD]
[TD="align: right"]-2429
[/TD]
[TD]WA2301
[/TD]
[TD="align: right"]3500
[/TD]
[TD="align: right"]3561
[/TD]
[/TR]
[TR]
[TD="align: center"]6
[/TD]
[TD]B011-6-8NSP
[/TD]
[TD]BGA23
[/TD]
[TD="align: right"]1000
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]1000
[/TD]
[/TR]
</tbody>[/TABLE]
Sheet2
[TABLE="width: 85%"]
<tbody>[TR]
[TD]
Worksheet Formulas[TABLE="class: grid, width: 100%"]
<tbody>[TR="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]
[TH="width: 10"]Cell
[/TH]
[TH="align: left"]Formula
[/TH]
[/TR]
[TR]
[TH="width: 10, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]H2
[/TH]
[TD="align: left"]=SUM(
C2,E2,G2)
[/TD]
[/TR]
[TR]
[TH="width: 10, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]H3
[/TH]
[TD="align: left"]=SUM(
C3,E3,G3)
[/TD]
[/TR]
[TR]
[TH="width: 10, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]H4
[/TH]
[TD="align: left"]=SUM(
C4,E4,G4)
[/TD]
[/TR]
[TR]
[TH="width: 10, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]H5
[/TH]
[TD="align: left"]=SUM(
C5,E5,G5)
[/TD]
[/TR]
[TR]
[TH="width: 10, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]H6
[/TH]
[TD="align: left"]=SUM(
C6,E6,G6)
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
Note since your sample shows only 3 locations I use the number in the header to get the K value for the small. If your locations go double digit then this will not work. You can replace the right function with the number.
[TABLE="class: grid, width: 85%"]
<tbody>[TR]
[TD]
Array Formulas[TABLE="class: grid, width: 100%"]
<tbody>[TR="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]
[TH="width: 10"]Cell
[/TH]
[TH="align: left"]Formula
[/TH]
[/TR]
[TR]
[TH="width: 10, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]B2
[/TH]
[TD="align: left"]{=IFERROR(
INDEX(Sheet1!$B$2:$B$10,SMALL(IF($A2=Sheet1!$A$2:$A$10,ROW(Sheet1!$B$2:$B$10)-ROW(Sheet1!$B$2)+1),RIGHT(B$1,1))),"")}
[/TD]
[/TR]
[TR]
[TH="width: 10, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]C2
[/TH]
[TD="align: left"]{=IFERROR(
INDEX(Sheet1!$C$2:$C$10,SMALL(IF($A2=Sheet1!$A$2:$A$10,ROW(Sheet1!$B$2:$B$10)-ROW(Sheet1!$B$2)+1),RIGHT(C$1,1)))+0,"")}
[/TD]
[/TR]
[TR]
[TH="width: 10, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]D2
[/TH]
[TD="align: left"]{=IFERROR(
INDEX(Sheet1!$B$2:$B$10,SMALL(IF($A2=Sheet1!$A$2:$A$10,ROW(Sheet1!$B$2:$B$10)-ROW(Sheet1!$B$2)+1),RIGHT(D$1,1))),"")}
[/TD]
[/TR]
[TR]
[TH="width: 10, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]E2
[/TH]
[TD="align: left"]{=IFERROR(
INDEX(Sheet1!$C$2:$C$10,SMALL(IF($A2=Sheet1!$A$2:$A$10,ROW(Sheet1!$B$2:$B$10)-ROW(Sheet1!$B$2)+1),RIGHT(E$1,1)))+0,"")}
[/TD]
[/TR]
[TR]
[TH="width: 10, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]F2
[/TH]
[TD="align: left"]{=IFERROR(
INDEX(Sheet1!$B$2:$B$10,SMALL(IF($A2=Sheet1!$A$2:$A$10,ROW(Sheet1!$B$2:$B$10)-ROW(Sheet1!$B$2)+1),RIGHT(F$1,1))),"")}
[/TD]
[/TR]
[TR]
[TH="width: 10, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]G2
[/TH]
[TD="align: left"]{=IFERROR(
INDEX(Sheet1!$C$2:$C$10,SMALL(IF($A2=Sheet1!$A$2:$A$10,ROW(Sheet1!$B$2:$B$10)-ROW(Sheet1!$B$2)+1),RIGHT(G$1,1))),"")}
[/TD]
[/TR]
[TR]
[TH="width: 10, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]B3
[/TH]
[TD="align: left"]{=IFERROR(
INDEX(Sheet1!$B$2:$B$10,SMALL(IF($A3=Sheet1!$A$2:$A$10,ROW(Sheet1!$B$2:$B$10)-ROW(Sheet1!$B$2)+1),RIGHT(B$1,1))),"")}
[/TD]
[/TR]
[TR]
[TH="width: 10, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]C3
[/TH]
[TD="align: left"]{=IFERROR(
INDEX(Sheet1!$C$2:$C$10,SMALL(IF($A3=Sheet1!$A$2:$A$10,ROW(Sheet1!$B$2:$B$10)-ROW(Sheet1!$B$2)+1),RIGHT(C$1,1)))+0,"")}
[/TD]
[/TR]
[TR]
[TH="width: 10, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]D3
[/TH]
[TD="align: left"]{=IFERROR(
INDEX(Sheet1!$B$2:$B$10,SMALL(IF($A3=Sheet1!$A$2:$A$10,ROW(Sheet1!$B$2:$B$10)-ROW(Sheet1!$B$2)+1),RIGHT(D$1,1))),"")}
[/TD]
[/TR]
[TR]
[TH="width: 10, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]E3
[/TH]
[TD="align: left"]{=IFERROR(
INDEX(Sheet1!$C$2:$C$10,SMALL(IF($A3=Sheet1!$A$2:$A$10,ROW(Sheet1!$B$2:$B$10)-ROW(Sheet1!$B$2)+1),RIGHT(E$1,1)))+0,"")}
[/TD]
[/TR]
[TR]
[TH="width: 10, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]F3
[/TH]
[TD="align: left"]{=IFERROR(
INDEX(Sheet1!$B$2:$B$10,SMALL(IF($A3=Sheet1!$A$2:$A$10,ROW(Sheet1!$B$2:$B$10)-ROW(Sheet1!$B$2)+1),RIGHT(F$1,1))),"")}
[/TD]
[/TR]
[TR]
[TH="width: 10, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]G3
[/TH]
[TD="align: left"]{=IFERROR(
INDEX(Sheet1!$C$2:$C$10,SMALL(IF($A3=Sheet1!$A$2:$A$10,ROW(Sheet1!$B$2:$B$10)-ROW(Sheet1!$B$2)+1),RIGHT(G$1,1))),"")}
[/TD]
[/TR]
[TR]
[TH="width: 10, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]B4
[/TH]
[TD="align: left"]{=IFERROR(
INDEX(Sheet1!$B$2:$B$10,SMALL(IF($A4=Sheet1!$A$2:$A$10,ROW(Sheet1!$B$2:$B$10)-ROW(Sheet1!$B$2)+1),RIGHT(B$1,1))),"")}
[/TD]
[/TR]
[TR]
[TH="width: 10, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]C4
[/TH]
[TD="align: left"]{=IFERROR(
INDEX(Sheet1!$C$2:$C$10,SMALL(IF($A4=Sheet1!$A$2:$A$10,ROW(Sheet1!$B$2:$B$10)-ROW(Sheet1!$B$2)+1),RIGHT(C$1,1)))+0,"")}
[/TD]
[/TR]
[TR]
[TH="width: 10, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]D4
[/TH]
[TD="align: left"]{=IFERROR(
INDEX(Sheet1!$B$2:$B$10,SMALL(IF($A4=Sheet1!$A$2:$A$10,ROW(Sheet1!$B$2:$B$10)-ROW(Sheet1!$B$2)+1),RIGHT(D$1,1))),"")}
[/TD]
[/TR]
[TR]
[TH="width: 10, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]E4
[/TH]
[TD="align: left"]{=IFERROR(
INDEX(Sheet1!$C$2:$C$10,SMALL(IF($A4=Sheet1!$A$2:$A$10,ROW(Sheet1!$B$2:$B$10)-ROW(Sheet1!$B$2)+1),RIGHT(E$1,1)))+0,"")}
[/TD]
[/TR]
[TR]
[TH="width: 10, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]F4
[/TH]
[TD="align: left"]{=IFERROR(
INDEX(Sheet1!$B$2:$B$10,SMALL(IF($A4=Sheet1!$A$2:$A$10,ROW(Sheet1!$B$2:$B$10)-ROW(Sheet1!$B$2)+1),RIGHT(F$1,1))),"")}
[/TD]
[/TR]
[TR]
[TH="width: 10, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]G4
[/TH]
[TD="align: left"]{=IFERROR(
INDEX(Sheet1!$C$2:$C$10,SMALL(IF($A4=Sheet1!$A$2:$A$10,ROW(Sheet1!$B$2:$B$10)-ROW(Sheet1!$B$2)+1),RIGHT(G$1,1))),"")}
[/TD]
[/TR]
[TR]
[TH="width: 10, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]B5
[/TH]
[TD="align: left"]{=IFERROR(
INDEX(Sheet1!$B$2:$B$10,SMALL(IF($A5=Sheet1!$A$2:$A$10,ROW(Sheet1!$B$2:$B$10)-ROW(Sheet1!$B$2)+1),RIGHT(B$1,1))),"")}
[/TD]
[/TR]
[TR]
[TH="width: 10, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]C5
[/TH]
[TD="align: left"]{=IFERROR(
INDEX(Sheet1!$C$2:$C$10,SMALL(IF($A5=Sheet1!$A$2:$A$10,ROW(Sheet1!$B$2:$B$10)-ROW(Sheet1!$B$2)+1),RIGHT(C$1,1)))+0,"")}
[/TD]
[/TR]
[TR]
[TH="width: 10, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]D5
[/TH]
[TD="align: left"]{=IFERROR(
INDEX(Sheet1!$B$2:$B$10,SMALL(IF($A5=Sheet1!$A$2:$A$10,ROW(Sheet1!$B$2:$B$10)-ROW(Sheet1!$B$2)+1),RIGHT(D$1,1))),"")}
[/TD]
[/TR]
[TR]
[TH="width: 10, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]E5
[/TH]
[TD="align: left"]{=IFERROR(
INDEX(Sheet1!$C$2:$C$10,SMALL(IF($A5=Sheet1!$A$2:$A$10,ROW(Sheet1!$B$2:$B$10)-ROW(Sheet1!$B$2)+1),RIGHT(E$1,1)))+0,"")}
[/TD]
[/TR]
[TR]
[TH="width: 10, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]F5
[/TH]
[TD="align: left"]{=IFERROR(
INDEX(Sheet1!$B$2:$B$10,SMALL(IF($A5=Sheet1!$A$2:$A$10,ROW(Sheet1!$B$2:$B$10)-ROW(Sheet1!$B$2)+1),RIGHT(F$1,1))),"")}
[/TD]
[/TR]
[TR]
[TH="width: 10, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]G5
[/TH]
[TD="align: left"]{=IFERROR(
INDEX(Sheet1!$C$2:$C$10,SMALL(IF($A5=Sheet1!$A$2:$A$10,ROW(Sheet1!$B$2:$B$10)-ROW(Sheet1!$B$2)+1),RIGHT(G$1,1))),"")}
[/TD]
[/TR]
[TR]
[TH="width: 10, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]B6
[/TH]
[TD="align: left"]{=IFERROR(
INDEX(Sheet1!$B$2:$B$10,SMALL(IF($A6=Sheet1!$A$2:$A$10,ROW(Sheet1!$B$2:$B$10)-ROW(Sheet1!$B$2)+1),RIGHT(B$1,1))),"")}
[/TD]
[/TR]
[TR]
[TH="width: 10, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]C6
[/TH]
[TD="align: left"]{=IFERROR(
INDEX(Sheet1!$C$2:$C$10,SMALL(IF($A6=Sheet1!$A$2:$A$10,ROW(Sheet1!$B$2:$B$10)-ROW(Sheet1!$B$2)+1),RIGHT(C$1,1)))+0,"")}
[/TD]
[/TR]
[TR]
[TH="width: 10, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]D6
[/TH]
[TD="align: left"]{=IFERROR(
INDEX(Sheet1!$B$2:$B$10,SMALL(IF($A6=Sheet1!$A$2:$A$10,ROW(Sheet1!$B$2:$B$10)-ROW(Sheet1!$B$2)+1),RIGHT(D$1,1))),"")}
[/TD]
[/TR]
[TR]
[TH="width: 10, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]E6
[/TH]
[TD="align: left"]{=IFERROR(
INDEX(Sheet1!$C$2:$C$10,SMALL(IF($A6=Sheet1!$A$2:$A$10,ROW(Sheet1!$B$2:$B$10)-ROW(Sheet1!$B$2)+1),RIGHT(E$1,1)))+0,"")}
[/TD]
[/TR]
[TR]
[TH="width: 10, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]F6
[/TH]
[TD="align: left"]{=IFERROR(
INDEX(Sheet1!$B$2:$B$10,SMALL(IF($A6=Sheet1!$A$2:$A$10,ROW(Sheet1!$B$2:$B$10)-ROW(Sheet1!$B$2)+1),RIGHT(F$1,1))),"")}
[/TD]
[/TR]
[TR]
[TH="width: 10, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]G6
[/TH]
[TD="align: left"]{=IFERROR(
INDEX(Sheet1!$C$2:$C$10,SMALL(IF($A6=Sheet1!$A$2:$A$10,ROW(Sheet1!$B$2:$B$10)-ROW(Sheet1!$B$2)+1),RIGHT(G$1,1))),"")}
[/TD]
[/TR]
</tbody>[/TABLE]
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself[/TD]
[/TR]
</tbody>[/TABLE]