Sumif with condition similar

alfordtp

Board Regular
Joined
Oct 3, 2008
Messages
62
When you filter a spreadsheet, you can find results that are similar to a condition. I have families of products that share a common 3 digits, but the rest of the model number is different. The 3 similar digits could be the first 3 digits, or it could be 3 digits starting with the 2nd digit. This spreadsheet has each complete model number on its own row. In that row is a number that represents a volume. I want to be able to sum the volume column if the model number contains the 3 digits.
Model NumberVolume
A hat5
B hat1
A glove4
hat8

<tbody>
</tbody>

In the above example, the total for "hat" = 5 + 1 + 8 = 14

I would type in a condition (family name) into another cell (D1) and the formula in D2.
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Try this

D1
hat

D2
=SUMPRODUCT(--ISNUMBER(SEARCH(D1,$A$2:$A$5)),$B$2:$B$5)

M.
 
Upvote 0
Excel does funny things when there are numbers and letters in the same cell.

For the example above, if there was another column with a sku associated, like 123a = a hat, 123b = b hat, 124a = a glove, and 123 = hat. How could I apply the above formula, or something similar, if I wanted to find all "123" records and sum that volume column?
 
Upvote 0
Excel does funny things when there are numbers and letters in the same cell.

For the example above, if there was another column with a sku associated, like 123a = a hat, 123b = b hat, 124a = a glove, and 123 = hat. How could I apply the above formula, or something similar, if I wanted to find all "123" records and sum that volume column?

Could you provide an example and expected result?

M.
 
Upvote 0
SKUModelVolume
123aA hat5
123bB hat1
124aA glove4
123hat8

<tbody>
</tbody>

SKUVolume Sum
1235 + 1 + 8 = 14

<tbody>
</tbody>

When I used the formula from above, it did not give me 14. I think it has to do with how the SKU column is stored as text or as a number. Is there a way around that?
 
Upvote 0
It worked perfectly for me



A

B

C

1

SKU​

Model​

Volume​

2

123a​

A hat​

5​

3

123b​

B hat​

1​

4

124a​

A glove​

4​

5

123​

hat​

8​

6

7

SKU​

Volume Sum​

8

123​

14​

<TBODY>
</TBODY>


Formula in B8
=SUMPRODUCT(--ISNUMBER(SEARCH(A8,$A$2:$A$5)),$C$2:$C$5)

M.
 
Upvote 0

Forum statistics

Threads
1,215,626
Messages
6,125,896
Members
449,271
Latest member
bergy32204

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