Which formula should i use to sum some table and some criteria

nasioedoeq

New Member
Joined
Apr 15, 2019
Messages
6
Hi All,


I have problem in using excel formula to provide the correct result for my store performance.
I already googling some formula, both Excel and Google Sheet but it make me confused because some formula didn't work.
From that references I am using syntax Sumproduct, Sumif, Index and Match but it dont provide the correct result.


Any suggestion?


NB: Here is my sheet
Store LocationItem NameSoldCategory
WakandaCandy A21295CandyCandy ACandy B
WakandaCandy B3399T ShirtT Shirt CT Shirt D
WakandaT Shirt C5393ShoesShoes YShoes Z
WakandaT Shirt D508HatHat LHat MHat N
WakandaShoes Y642GlovesGloves FGloves GGloves H
WakandaShoes Z10
GothamCandy A194
GothamCandy B2910
GothamT Shirt C664
GothamT Shirt D760Store PerformanceCategorySold
GothamShoes Y0WakandaCandy?
GothamShoes Z0WakandaT Shirt?
GothamHat L83WakandaShoes?
GothamHat M282WakandaHat?
GothamHat N212WakandaGloves?
GothamGloves F33440GothamCandy?
GothamGloves G185GothamT Shirt?
GothamGloves H22GothamShoes?
SmallvilleCandy A501GothamHat?
SmallvilleCandy B2289GothamGloves?
SmallvilleT Shirt C701SmallvilleCandy?
SmallvilleT Shirt D4941SmallvilleT Shirt?
SmallvilleShoes Y7SmallvilleShoes?
SmallvilleShoes Z2245SmallvilleHat?
SmallvilleHat L5960SmallvilleGloves?
SmallvilleHat M1091

<tbody>
</tbody>
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Hi Steve, thank you for your suggestion, it works very well if item name will use simple name and have exact name just like above example.

Apologize for missing information, actually each Item Name has complex combination name , that's why i have to refer to both table (Store Location and Category) and sum all of that into table Store Performance

Hope my explanation are clear and really need suggestion

Hi. Try something like this:

=SUMIFS($C$2:$C$27,$A$2:$A$27,E12,$B$2:$B$27,"*"&F12&"*")
 
Upvote 0
Ah ok so thats a list of the names you want to sum?

=SUMPRODUCT(SUMIFS($C$2:$C$27,$A$2:$A$27,E12,$B$2:$B$27,INDEX($F$2:$O$6,MATCH(F12,$E$2:$E$6,0),0)))
 
Upvote 0
Hi Steve, thanks again for your responses, but the formula dont give the correct result. Most of them is (0)
I don't have any idea and knowledge to edit or change any section.

Need advice

Ah ok so thats a list of the names you want to sum?

=SUMPRODUCT(SUMIFS($C$2:$C$27,$A$2:$A$27,E12,$B$2:$B$27,INDEX($F$2:$O$6,MATCH(F12,$E$2:$E$6,0),0)))
 
Upvote 0
Whyy not put the data into a Pivot table

Row\Col
H​
I​
J​
K​
L​
16​
17​
18​
Sum of SoldColumn Labels
19​
Row LabelsGothamSmallvilleWakandaGrand Total
20​
Candy A
194​
501​
21295​
21990​
21​
Candy B
2910​
2289​
3399​
8598​
22​
Gloves F
33440​
33440​
23​
Gloves G
185​
185​
24​
Gloves H
22​
22​
25​
Hat L
83​
5960​
6043​
26​
Hat M
282​
1091​
1373​
27​
Hat N
212​
212​
28​
Shoes Y
0​
7​
642​
649​
29​
Shoes Z
0​
2245​
10​
2255​
30​
T Shirt C
664​
701​
5393​
6758​
31​
T Shirt D
760​
4941​
508​
6209​
32​
Grand Total
38752​
17735​
31247​
87734​
33​
 
Upvote 0
Here is the result (i attached the table as well)

<style type="text/css"><!--td {border: 1px solid #ccc;}br {mso-data-placement:same-cell;}--></style>
Store LocationItem NameItem SoldCategoryItem NameItem NameItem Name
WakandaCandy A21295CandyCandy ACandy B
WakandaCandy B3399T ShirtT Shirt CT Shirt D
WakandaT Shirt C5393ShoesShoes YShoes Z
WakandaT Shirt D508HatHat LHat MHat N
WakandaShoes Y642GlovesGloves FGloves GGloves H
WakandaShoes Z10
GothamCandy A194
GothamCandy B2910
GothamT Shirt C664
GothamT Shirt D760Store PerformanceCategoryCategory SoldCategory Sold
GothamShoes Y0WakandaCandy339924694
GothamShoes Z0WakandaT Shirt5085901
GothamHat L83WakandaShoes10652
GothamHat M282WakandaHat00
GothamHat N212WakandaGloves00
GothamGloves F33440GothamCandy29103104
GothamGloves G185GothamT Shirt7601424
GothamGloves H22GothamShoes00
SmallvilleCandy A501GothamHat282577
SmallvilleCandy B2289GothamGloves18533647
SmallvilleT Shirt C701SmallvilleCandy22892790
SmallvilleT Shirt D4941SmallvilleT Shirt49415642
SmallvilleShoes Y7SmallvilleShoes22452252
SmallvilleShoes Z2245SmallvilleHat10917051
SmallvilleHat L5960SmallvilleGloves00
SmallvilleHat M1091

<colgroup><col style="width: 100px"><col width="100"><col width="100"><col width="100"><col width="118"><col width="72"><col width="89"><col width="89"><col width="100"></colgroup><tbody>
</tbody>

FYI, the red color use this formula =SUMPRODUCT(SUMIFS($C$2:$C$27,$A$2:$A$27,E12,$B$2:$B$27,INDEX($F$2:$O$6,MATCH(F12,$E$2:$E$6,0),0)))
while the blue color use your first formula =SUMIFS($C$2:$C$27,$A$2:$A$27,E12,$B$2:$B$27,"*"&F12&"*")

Actually the red color give the correct result, but if I implement the formula at the original Item Name, which is much more complicated (long character and unique) then it will not give the correct result.

Please help

<style type="text/css"><!--td {border: 1px solid #ccc;}br {mso-data-placement:same-cell;}--></style><style type="text/css"><!--td {border: 1px solid #ccc;}br {mso-data-placement:same-cell;}--></style>
Based on the test data you gave what are the results?
 
Upvote 0
I am not using pivot because I need to know the category sold by each store location, while each category consist of some Item

<style type="text/css"><!--td {border: 1px solid #ccc;}br {mso-data-placement:same-cell;}--></style>
Store PerformanceCategoryCategory Sold
WakandaCandy?
WakandaT Shirt?
WakandaShoes?
WakandaHat?
WakandaGloves?
GothamCandy?
GothamT Shirt?
GothamShoes?
GothamHat?
GothamGloves?
SmallvilleCandy?
SmallvilleT Shirt?
SmallvilleShoes?
SmallvilleHat?
SmallvilleGloves?

<colgroup><col style="width: 118px"><col width="72"><col width="89"></colgroup><tbody>
</tbody>

<style type="text/css"><!--td {border: 1px solid #ccc;}br {mso-data-placement:same-cell;}--></style>
Whyy not put the data into a Pivot table

Row\Col
H​
I​
J​
K​
L​
16​
17​
18​
Sum of SoldColumn Labels
19​
Row LabelsGothamSmallvilleWakandaGrand Total
20​
Candy A
194​
501​
21295​
21990​
21​
Candy B
2910​
2289​
3399​
8598​
22​
Gloves F
33440​
33440​
23​
Gloves G
185​
185​
24​
Gloves H
22​
22​
25​
Hat L
83​
5960​
6043​
26​
Hat M
282​
1091​
1373​
27​
Hat N
212​
212​
28​
Shoes Y
0​
7​
642​
649​
29​
Shoes Z
0​
2245​
10​
2255​
30​
T Shirt C
664​
701​
5393​
6758​
31​
T Shirt D
760​
4941​
508​
6209​
32​
Grand Total
38752​
17735​
31247​
87734​
33​

<tbody>
</tbody>
 
Upvote 0
Here is the result (by using your latest formula)

<style type="text/css"><!--td {border: 1px solid #ccc;}br {mso-data-placement:same-cell;}--></style>
Store PerformanceCategoryCategory Sold
WakandaCandy3399
WakandaT Shirt508
WakandaShoes10
WakandaHat0
WakandaGloves0
GothamCandy2910
GothamT Shirt760
GothamShoes0
GothamHat282
GothamGloves185
SmallvilleCandy2289
SmallvilleT Shirt4941
SmallvilleShoes2245
SmallvilleHat1091
SmallvilleGloves0

<colgroup><col style="width: 118px"><col width="72"><col width="89"></colgroup><tbody>
</tbody>

Based on the test data you gave what are the results?
 
Upvote 0

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,399
Latest member
alchavar

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