Sum items from a single cell

FaezMH

New Member
Joined
Oct 14, 2019
Messages
39
Office Version
  1. 365
Platform
  1. Windows
Hi Guys,

I have a problem as below where I intend to sum a range that include certain cell containing 2 items. I can only figure now by using sumproduct that has condition set in. However, when I removed that condition, it all became zero. I tried to include countif into sumproduct but it did not work. Kindly advise.

sumproduct.xlsx
ABCDEFG
5Serial NoTotalExpected
6a) 64B00115, b) 64B00120,c) 64B00116 d) 64B0012164B0011764B0011864B0011937
Sheet2
Cell Formulas
RangeFormula
F6F6=SUMPRODUCT((LEN($A$6:$E$6)-LEN(SUBSTITUTE($A$6:$E$6,"b)","")))/LEN("b)")+(LEN($A$6:$E$6)-LEN(SUBSTITUTE($A$6:$E$6,"c)","")))/LEN("c)")+(LEN($A$6:$E$6)-LEN(SUBSTITUTE($A$6:$E$6,"d)","")))/LEN("d)"))
Press CTRL+SHIFT+ENTER to enter array formulas.


Thanks.
Faez
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Not the most elegant solution bu will work:

Excel Formula:
=FLOOR(LEN(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(CONCATENATE($A6, $B6, $C6, $D6, $E6, )," ",""), ",", ""), "a", ""), "b", ""), "c", ""), "d", ""), ")", ""))/8, 1)
 
Upvote 0
Maybe
Fluff.xlsm
ABCDEF
5Serial NoTotal
6a) 64B00115, b) 64B00120,c) 64B00116 d) 64B0012164B0011764B0011864B001197
Main
Cell Formulas
RangeFormula
F6F6=ROWS(TEXTSPLIT(TEXTJOIN(CHAR(10),,A6:E6),,CHAR(10)))
 
Upvote 0
Solution
Not the most elegant solution bu will work:

Excel Formula:
=FLOOR(LEN(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(CONCATENATE($A6, $B6, $C6, $D6, $E6, )," ",""), ",", ""), "a", ""), "b", ""), "c", ""), "d", ""), ")", ""))/8, 1)
Hi Flashbond,

Thanks for the prompt reply. But somehow there's something missing in the formula.
 
Upvote 0
Maybe
Fluff.xlsm
ABCDEF
5Serial NoTotal
6a) 64B00115, b) 64B00120,c) 64B00116 d) 64B0012164B0011764B0011864B001197
Main
Cell Formulas
RangeFormula
F6F6=ROWS(TEXTSPLIT(TEXTJOIN(CHAR(10),,A6:E6),,CHAR(10)))
Hi Fluff,

Thanks. This really helps to solve the problem. It did not come to my mind at all that this formula is so powerful.
A lot more for me to learn from you guys and the forum :)

Thanks again for your help.
Regards,
Faez
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,561
Messages
6,120,225
Members
448,951
Latest member
jennlynn

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