Formula to sum list with simular SKU

foxtrapperscott

New Member
Joined
Oct 4, 2008
Messages
31
I looking for a formula that will search a list of SKU that are similar and sum the sales totals in a cell with the Primary SKU. So a formula that looks for S650 in the data and gives the sum of all with similar SKU as the result. The example may be more helpful below to see what I'm trying to accomplish. Thanks for your help, I greatly appreciate it!


DATASALESCOMBINED SKUTOTAL SALES
S6502S65015
S650 IT45S7509
S650 T48S8508
S7509
S8503
S850 T45

<tbody>
</tbody>
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
In your example if "Data" is in cell A1 then how about this copied down starting in cell F2 (TOTAL SALES)

Code:
=SUMIFS(B2:B7,A2:A7, "*" & E2 & "*")
 
Last edited:
Upvote 0
Let's create tables for each of these, it'll simplify matters. Select the SKU table and hit CTRL<ctrl>+T.
Select the Totals Table and hit CTRL<ctrl>+T again. Now you have 2 tables. If you don't rename them, they'll automatically be called Table1 and Table2.

Now, you can enter the following formula in the TOTAL SALES column: =SUMIF(Table1[DATA], [@[COMBINED SKU]] & "*", Table1[SALES])</ctrl></ctrl>
 
Last edited:
Upvote 0
Not sure which solution you are using, but either way I am happy you got it working. Thanks for the feedback.
 
Upvote 0
I have ran into a bump in the road with the formula that "igold" shared. The scenario changed when I had an SKU that was "E32I" and a different SKU, but similar "E32". It is currently giving me the same result for both SKU's. How can I change the formula to recognize the difference in SKU?
Thanks for taking time to help!
 
Upvote 0
I recommend that you don't prepend the wildcard, but use the formula I suggested above. Then, the Total Sales will match whatever starts with the text you put in the COMBINED SKU column.
If you put in E32, it will match E32, E32I, etc., if you put in E32I, it will match only items that begin with that.
 
Upvote 0
@UniMord

I tried your suggestion and the SKU E32 in the Combined SKU table picks up the totals for both E32 and E32I.
 
Upvote 0
It seems that you want everything that comes after a space to be ignored, but the SKU before the space to be significant. If that's correct, then, we should use the following formula:

=SUMPRODUCT((LEFT(Table1[DATA], FIND(" ", Table1[DATA] & " ")-1)=[@[COMBINED SKU]])*Table1[SALES])
 
Upvote 0

Forum statistics

Threads
1,215,525
Messages
6,125,325
Members
449,218
Latest member
Excel Master

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