Using SUMIF for multiple values separated by comma??

HockeyDiablo

Board Regular
Joined
Apr 1, 2016
Messages
182
I will have column information that will list entries like this:
DD, DD9, SD, LHR, HIGHLIFT
BOTTOM SECTION, DD, D9
DD, PVC DD, SD, LHR, HIGHLIFT

Is there a way to run a SUMIF or other formula on these and separate the values from the commas? I am familiar with Text to Columns but I will be using 22 unique values "DD, DD9..."


[TABLE="width: 179"]
<colgroup><col><col></colgroup><tbody>[TR]
[TD]DD[/TD]
[TD="align: right"]0.3[/TD]
[/TR]
[TR]
[TD]DD9[/TD]
[TD="align: right"]0.5[/TD]
[/TR]
[TR]
[TD]SD[/TD]
[TD="align: right"]0.8[/TD]
[/TR]
[TR]
[TD]LHR[/TD]
[TD="align: right"]1.3[/TD]
[/TR]
[TR]
[TD]HIGHLIFT[/TD]
[TD="align: right"]1.5[/TD]
[/TR]
[TR]
[TD]BOTTOM SECTION[/TD]
[TD="align: right"]2[/TD]
[/TR]
</tbody>[/TABLE]

So the outcome would look something like this.

DD, DD9, SD, LHR, HIGHLIFT 4.25
BOTTOM SECTION, DD, D9 2.75
DD, SD, LHR, HIGHLIFT 3.75

Appreciate it.
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
The below has 2 similar options. Personally I'd go with SUMPRODUCT.

Excel Workbook
ABCDEFGHI
1DD0.3
2DD90.5
3SD0.8
4LHR1.3
5HIGHLIFT1.5
6BOTTOM SECTION2
7
8
9
104.44.4DDDD9SDLHRHIGHLIFT
112.32.3BOTTOM SECTIONDD
123.93.9DDSDLHRHIGHLIFT
Sheet1
 
Upvote 0
Welcome to Mr Excel

Maybe this


[Table="class: grid"][tr][td="bgcolor: #DCE6F1"][/td][td="bgcolor: #DCE6F1"]
A
[/td][td="bgcolor: #DCE6F1"]
B
[/td][td="bgcolor: #DCE6F1"]
C
[/td][td="bgcolor: #DCE6F1"]
D
[/td][td="bgcolor: #DCE6F1"]
E
[/td][/tr]
[tr][td="bgcolor: #DCE6F1"]
1
[/td][td]
Code​
[/td][td]
Value​
[/td][td][/td][td]
Codes​
[/td][td]
Total​
[/td][/tr]


[tr][td="bgcolor: #DCE6F1"]
2
[/td][td]
DD​
[/td][td]
0,3​
[/td][td][/td][td]
DD, DD9, SD, LHR, HIGHLIFT​
[/td][td]
4,4​
[/td][/tr]


[tr][td="bgcolor: #DCE6F1"]
3
[/td][td]
DD9​
[/td][td]
0,5​
[/td][td][/td][td]
BOTTOM SECTION, DD, DD9​
[/td][td]
2,8​
[/td][/tr]


[tr][td="bgcolor: #DCE6F1"]
4
[/td][td]
SD​
[/td][td]
0,8​
[/td][td][/td][td]
DD, SD, LHR, HIGHLIFT​
[/td][td]
3,9​
[/td][/tr]


[tr][td="bgcolor: #DCE6F1"]
5
[/td][td]
LHR​
[/td][td]
1,3​
[/td][td][/td][td][/td][td][/td][/tr]


[tr][td="bgcolor: #DCE6F1"]
6
[/td][td]
HIGHLIFT​
[/td][td]
1,5​
[/td][td][/td][td][/td][td][/td][/tr]


[tr][td="bgcolor: #DCE6F1"]
7
[/td][td]
BOTTOM SECTION​
[/td][td]
2​
[/td][td][/td][td][/td][td][/td][/tr]
[/table]


Formula in E2 copied down
=SUMPRODUCT(--ISNUMBER(SEARCH($A$2:$A$7&",",D2&",")),$B$2:$B$7)

Hope this helps

M.
 
Upvote 0

Forum statistics

Threads
1,223,240
Messages
6,170,951
Members
452,368
Latest member
jayp2104

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