Index product based on Location + sum

anoop0085

New Member
Joined
Aug 4, 2022
Messages
9
Office Version
  1. 2016
Platform
  1. Windows
Guy below you can see i have excel sheet (2016) were i am posting day to day purchases . Each it kept in a particular location/ boxes on each posting. Now i need a formula to index all items(cell no I8 to below) which in particular a box (cell no h7) with total qty purchased in that box . Hope you understand and help me with the formula

Test store.xlsx
ABCDEFGHIJK
1Date of PurchaseItem purchasedqtyLocation
25/4/2022Item A2Box 1
35/5/2022Item B1Box 2
45/6/2022Item C1Box 2
55/7/2022Item B2Box 1
65/8/2022Item D1Box 3
75/9/2022Item A2Box 4Location :Box 1Item ListTotal qty
85/10/2022Item E1Box 1??
95/11/2022Item E1Box 3??
105/12/2022Item D3Box 4??
115/13/2022Item C1Box 1??
125/14/2022Item B5Box 1??
135/15/2022Item D1Box 2??
145/16/2022Item A1Box 2??
155/17/2022Item E2Box 3??
165/18/2022Item B6Box 4??
175/19/2022Item D1Box 1??
185/20/2022Item C1Box 2??
195/21/2022Item B4Box 4??
205/22/2022Item D1Box 3??
21??
22
Sheet1
Cells with Data Validation
CellAllowCriteria
H7List=$M$2:$M$5
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Use formulas as below:

I8 => =SORT(UNIQUE(FILTER(B2:B19,D2:D19=H7)))
J8=> =SUMIFS($C$2:$C$19,$B$2:$B$19,I8,$D$2:$D$19,$H$7)
 
Upvote 0
1659597978794.png
 
Upvote 0
@Mposwal
If you look at what is written in post #1 and at the OP's details in the left hand column you will see that they are using Excel 2016 so will not have access to some of the functions that you are suggesting.

@anoop0085
Can you post another mini-sheet with the expected results manually filled in?
 
Upvote 0
@Mposwal
If you look at what is written in post #1 and at the OP's details in the left hand column you will see that they are using Excel 2016 so will not have access to some of the functions that you are suggesting.

@anoop0085
Can you post another mini-sheet with the expected results manually filled in?
Test store.xlsx
ABCDEFGHIJ
1Date of PurchaseItem purchasedqtyLocation
25/4/2022Item A2Box 1
35/5/2022Item B1Box 2
45/6/2022Item C1Box 2
55/7/2022Item B2Box 1
65/8/2022Item D1Box 3
75/9/2022Item A2Box 4Location :Box 1Item ListTotal qty
85/10/2022Item E1Box 1Item A2
95/11/2022Item E1Box 3Item B2+5=7
105/12/2022Item D3Box 4Item E1
115/13/2022Item C1Box 1Item C1
125/14/2022Item B5Box 1Item D1
135/15/2022Item D1Box 2??
145/16/2022Item A1Box 2??
155/17/2022Item E2Box 3??
165/18/2022Item B6Box 4??
175/19/2022Item D1Box 1??
185/20/2022Item C1Box 2??
195/21/2022Item B4Box 4??
205/22/2022Item D1Box 3
21
22
Sheet1
Cells with Data Validation
CellAllowCriteria
H7List=$M$2:$M$5
 
Upvote 0
Thanks for the additional information. Try this.

22 08 04.xlsm
ABCDEFGHIJ
1Date of PurchaseItem purchasedqtyLocation
25/04/2022Item A2Box 1
35/05/2022Item B1Box 2
45/06/2022Item C1Box 2
55/07/2022Item B2Box 1
65/08/2022Item D1Box 3
75/09/2022Item A2Box 4Location :Box 1Item ListTotal qty
85/10/2022Item E1Box 1Item A2
95/11/2022Item E1Box 3Item B7
105/12/2022Item D3Box 4Item E1
115/13/2022Item C1Box 1Item C1
125/14/2022Item B5Box 1Item D1
135/15/2022Item D1Box 2  
145/16/2022Item A1Box 2  
155/17/2022Item E2Box 3  
165/18/2022Item B6Box 4  
175/19/2022Item D1Box 1  
185/20/2022Item C1Box 2  
195/21/2022Item B4Box 4  
205/22/2022Item D1Box 3  
Qty
Cell Formulas
RangeFormula
I8:I20I8=IFERROR(INDEX(B:B,AGGREGATE(15,6,ROW(B$2:B$20)/((D$2:D$20=H$7)*ISNA(MATCH(B$2:B$20,I$7:I7,0))),1)),"")
J8:J20J8=IF(I8="","",SUMIFS(C$2:C$20,B$2:B$20,I8,D$2:D$20,H$7))
 
Upvote 0
Solution
Thanks for the additional information. Try this.

22 08 04.xlsm
ABCDEFGHIJ
1Date of PurchaseItem purchasedqtyLocation
25/04/2022Item A2Box 1
35/05/2022Item B1Box 2
45/06/2022Item C1Box 2
55/07/2022Item B2Box 1
65/08/2022Item D1Box 3
75/09/2022Item A2Box 4Location :Box 1Item ListTotal qty
85/10/2022Item E1Box 1Item A2
95/11/2022Item E1Box 3Item B7
105/12/2022Item D3Box 4Item E1
115/13/2022Item C1Box 1Item C1
125/14/2022Item B5Box 1Item D1
135/15/2022Item D1Box 2  
145/16/2022Item A1Box 2  
155/17/2022Item E2Box 3  
165/18/2022Item B6Box 4  
175/19/2022Item D1Box 1  
185/20/2022Item C1Box 2  
195/21/2022Item B4Box 4  
205/22/2022Item D1Box 3  
Qty
Cell Formulas
RangeFormula
I8:I20I8=IFERROR(INDEX(B:B,AGGREGATE(15,6,ROW(B$2:B$20)/((D$2:D$20=H$7)*ISNA(MATCH(B$2:B$20,I$7:I7,0))),1)),"")
J8:J20J8=IF(I8="","",SUMIFS(C$2:C$20,B$2:B$20,I8,D$2:D$20,H$7))
Your formula is working but some reason when i click box 1 nothing is showing , any suggestion ?- other is working
 

Attachments

  • excel.JPG
    excel.JPG
    134.5 KB · Views: 3
Upvote 0
Everything working okay now?
I notice that it looks like you have entered the formula as an array formula (Ctrl+Shift+Enter). I don't think that you should need to do that.
 
Upvote 0

Forum statistics

Threads
1,215,753
Messages
6,126,678
Members
449,327
Latest member
John4520

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