What is the formula to lookup quantity of an item code by different location sorting?

iMailMan

New Member
Joined
Sep 6, 2018
Messages
12
Here is the table of the data for your reference:
[TABLE="class: grid, width: 200, align: center"]
<tbody>[TR]
[TD="align: center"]Location[/TD]
[TD="align: center"]Item Code[/TD]
[TD="align: center"]Qty[/TD]
[/TR]
[TR]
[TD="align: center"]A[/TD]
[TD="align: center"]123[/TD]
[TD="align: center"]1000[/TD]
[/TR]
[TR]
[TD="align: center"]B[/TD]
[TD="align: center"]456[/TD]
[TD="align: center"]700[/TD]
[/TR]
[TR]
[TD="align: center"]A[/TD]
[TD="align: center"]789[/TD]
[TD="align: center"]2000[/TD]
[/TR]
[TR]
[TD="align: center"]B[/TD]
[TD="align: center"]123[/TD]
[TD="align: center"]500[/TD]
[/TR]
[TR]
[TD="align: center"]A[/TD]
[TD="align: center"]456[/TD]
[TD="align: center"]1200[/TD]
[/TR]
[TR]
[TD="align: center"]B[/TD]
[TD="align: center"]789[/TD]
[TD="align: center"]3500[/TD]
[/TR]
</tbody>[/TABLE]


Here is the table for data entry:
[TABLE="class: grid, width: 300, align: center"]
<tbody>[TR]
[TD="align: center"][/TD]
[TD="align: center"]Qty[/TD]
[TD="align: center"]Qty[/TD]
[/TR]
[TR]
[TD="align: center"]Item Code[/TD]
[TD="align: center"]Location A[/TD]
[TD="align: center"]Location B[/TD]
[/TR]
[TR]
[TD="align: center"]123[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]456[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]789[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


I have try many formula like Vlookup+Hlookup or Index+Match or Vlookup+Match still not successful to get the data entry on the above table mentioned.
Please help and educate me.


Thanks.
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Can i say Sumproduct is a function to sum up the quantity? If yes, this is not i want.
I actually want to fill the quantity of an item code by location.
 
Upvote 0
you are right, but in your case, it will give the quantity of item by location.
 
Upvote 0
Hi iMailMan

Firstly, suggest you don't start another thread - combine any additional information into the original thread.

If your data body range is in range A2:C7, and your results table is in F3, insert the following formula into F3 and copy it across the range F3:G5:

Code:
=SUMPRODUCT(--($A$2:$A$7=RIGHT(F$2,1)),--($B$2:$B$7=$E3),$C$2:$C$7)

Cheers

pvr928
 
Upvote 0
Have a look:

[TABLE="width: 192"]
<colgroup><col width="64" span="3" style="width:48pt"> </colgroup><tbody>[TR]
[TD="class: xl63, width: 64"]A[/TD]
[TD="class: xl63, width: 64, align: right"]123[/TD]
[TD="class: xl63, width: 64, align: right"]1000[/TD]
[/TR]
[TR]
[TD="class: xl63"]B[/TD]
[TD="class: xl63, align: right"]456[/TD]
[TD="class: xl63, align: right"]700[/TD]
[/TR]
[TR]
[TD="class: xl63"]A[/TD]
[TD="class: xl63, align: right"]789[/TD]
[TD="class: xl63, align: right"]2000[/TD]
[/TR]
[TR]
[TD="class: xl63"]B[/TD]
[TD="class: xl63, align: right"]123[/TD]
[TD="class: xl63, align: right"]500[/TD]
[/TR]
[TR]
[TD="class: xl63"]A[/TD]
[TD="class: xl63, align: right"]456[/TD]
[TD="class: xl63, align: right"]1200[/TD]
[/TR]
[TR]
[TD="class: xl63"]B[/TD]
[TD="class: xl63, align: right"]789[/TD]
[TD="class: xl63, align: right"]3500[/TD]
[/TR]
[TR]
[TD="class: xl63"] [/TD]
[TD="class: xl63"] [/TD]
[TD="class: xl63"] [/TD]
[/TR]
[TR]
[TD="class: xl63"] [/TD]
[TD="class: xl63"] [/TD]
[TD="class: xl63"] [/TD]
[/TR]
[TR]
[TD="class: xl63"] [/TD]
[TD="class: xl63"] [/TD]
[TD="class: xl63"] [/TD]
[/TR]
[TR]
[TD="class: xl63"]Qty[/TD]
[TD="class: xl63"]Qty[/TD]
[TD="class: xl63"] [/TD]
[/TR]
[TR]
[TD="class: xl63"]Item Code[/TD]
[TD="class: xl63"]Location A[/TD]
[TD="class: xl63"]Location B[/TD]
[/TR]
[TR]
[TD="class: xl63, align: right"]123[/TD]
[TD="class: xl63, align: right"]1000[/TD]
[TD="class: xl63, align: right"]500[/TD]
[/TR]
[TR]
[TD="class: xl63, align: right"]456[/TD]
[TD="class: xl63, align: right"]1200[/TD]
[TD="class: xl63, align: right"]700[/TD]
[/TR]
[TR]
[TD="class: xl63, align: right"]789[/TD]
[TD="class: xl63, align: right"]2000[/TD]
[TD="class: xl63, align: right"]3500
[/TD]
[/TR]
</tbody>[/TABLE]
The formula I used was
Code:
=SUMPRODUCT(--($A$1:$A$6=RIGHT(B$11,1)),--($B$1:$B$6=$A12),$C$1:$C$6)
 
Upvote 0
Welcome to the MrExcel board!

If the combinations of location & Code in the lookup table are unique (which I expect they are) and you have a reasonably recent version of Excel & have the SUMIFS function then you could also use this.
(I have removed the "Location" text from row 11 to make the formulas simpler though it could be done without this removal if needed.)

Formula in B12 is copied across and down.

Excel Workbook
ABC
1LocationItem CodeQty
2A1231000
3B456700
4A7892000
5B123500
6A4561200
7B7893500
8
9
10QtyQty
11Item CodeAB
121231000500
134561200700
1478920003500
Qty
 
Upvote 0
Thanks for your guide.
I got it and it really works well for my table.

Again, appreciated every above master for your kind assistance.
 
Upvote 0

Forum statistics

Threads
1,223,910
Messages
6,175,318
Members
452,634
Latest member
cpostell

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