collect sum if cell contain specific text

tonyrensya

New Member
Joined
Jul 24, 2013
Messages
24
Office Version
  1. 2019
Platform
  1. Windows
  2. MacOS
Hello,

Here's my question.
I want collect sum of the cell besides the cell if cell contain specific text (Name)
target formula in A2 to D2

Thank you!
 

Attachments

  • sample.png
    sample.png
    147.4 KB · Views: 14

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Hi Tony,

Try this formula (there's other ways I'm sure) in cell A2...

Excel Formula:
=SUMIF($A$4:$A$8,"*"&A1&"*",$B$4:$B$8)+SUMIF($C$4:$C$8,"*"&A1&"*",$D$4:$D$8)

...and copy it across to B2:D2

Note Jack's count is 10 not seven as per your screen shot.

Regards,

Robert
 
Last edited:
Upvote 0
Thank you Robert!
I have way more columns and rows in the actual table, the formula will be too long, maybe there's another way?
 
Upvote 0
No I don't know of another way :( but someone in the forum will I'm sure :)
 
Upvote 0
Hi, here's a couple of options, if you can have names that are subsets of other names then the SUMPRODUCT() option is more robust (as demonstrated).

tempp.xlsx
ABCDEF
1TomMaryJackJanJackson
222212275
322211775
4
5Tom Mary3Mary Jack2Jackson5
6Jack Jan3Tom Jack2Mary4
7Tom Jack3Mary Jan2Mary5
8Tom3Jan2Tom4
9Mary3Mary2Tom Jack7
Sheet1
Cell Formulas
RangeFormula
A2:E2A2=SUMIFS($B$5:$F$9,$A$5:$E$9,"*"&A1&"*")
A3:E3A3=SUMPRODUCT($B$5:$F$9,--ISNUMBER(SEARCH(" "&A1&" "," "&$A$5:$E$9&" ")))
 
Upvote 0
Hi, here's a couple of options, if you can have names that are subsets of other names then the SUMPRODUCT() option is more robust (as demonstrated).

tempp.xlsx
ABCDEF
1TomMaryJackJanJackson
222212275
322211775
4
5Tom Mary3Mary Jack2Jackson5
6Jack Jan3Tom Jack2Mary4
7Tom Jack3Mary Jan2Mary5
8Tom3Jan2Tom4
9Mary3Mary2Tom Jack7
Sheet1
Cell Formulas
RangeFormula
A2:E2A2=SUMIFS($B$5:$F$9,$A$5:$E$9,"*"&A1&"*")
A3:E3A3=SUMPRODUCT($B$5:$F$9,--ISNUMBER(SEARCH(" "&A1&" "," "&$A$5:$E$9&" ")))

Thank you FormR!
It works great for me.
 
Upvote 0

Forum statistics

Threads
1,223,164
Messages
6,170,444
Members
452,326
Latest member
johnshaji

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