Skip to main content

How to sumif cells if contains part of text string in Goolge sheets? 

To sum cell values in a column if another column cells contain a part of specific text string as following screenshot shown, this article will introduce some useful formula to solve this task in Google sheets.

doc sumif contains text 1

Sumif cells if contains part of specific text string in Google sheets with formulas


Sumif cells if contains part of specific text string in Google sheets with formulas

The following formulas can help you to sum cell values if another column cells contain specific text string, please do as this:

1. Enter this formula: =sum(filter(B2:B9, regexmatch(A2:A9, "KTE"))) into a blank cell, and then press Enter key to get the result, see screenshot:

doc sumif contains text 2

Notes:

1. In the above formula: B2:B9 is the cell values that you want to sum, A2:A9 is the range contains the specific text string, “KTE” is the specific text you want to sum based on, please change them to your need.

2. Here is another formula also can help you: =sumif(A2:A9,"*KTE*",B2:B9).

Best Office Productivity Tools

🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions
Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |   Round without Formula ...
Super Lookup: Multiple Criteria VLookup    Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |   Big Formula Bar    Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells    Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more

Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time.  Click Here to Get The Feature You Need The Most...

Description


Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
Comments (9)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Hello, Thank for super post. I had was able to solve few issues with it. I still have one issue isuse- I am unable to sum up if there is a number in condition column say "=SUMIF(B9:B2414;"85*";E9:E2414)" where B can contains values like "ABC", "851", "865", "LUX",etc.
This comment was minimized by the moderator on the site
Hello !
Thank you for this tuto.

Is it possible to sum numbers included in cells if those cells also include a specific word ?

For example :
"car 2"
"house 1"
"dog 7"
"plate 3"
"screen 4"
"horse 2"
"battery 9"
"floor 1"
"river 2"
"plane 0"
"butterfly 7"
"horse 1"
"plate 0"
"house 12"

Formula to find total of house ?
Answer in this examle is 13

"house 1" is the content of one cell. I can't transfer the content in to different cells.
Thank you for your help.

https://i.postimg.cc/26LrtGNt/sumif.jpg
This comment was minimized by the moderator on the site
Thanks for this. I found both techniques shown work, EXCEPT that the filter and regex method returns an N/A error if there are not matches to the filter. So when I have a number of these formulas in a column and then sum the total, using that method causes the sum to return N/A and therefore the totals to break.  However using the sumif and *KTE* method returns a sum of 0 if there are no results, so the summing of totals still works. 
This comment was minimized by the moderator on the site
Hello jodamo5,I get your point. Indeed, the filter and regex method returns an #N/A error when there are no matches to filter. Therefore, I recommend the sumif method. Thanks for your notice. Your support means a lot to us. Have a great day.Sincerely,Mandy
This comment was minimized by the moderator on the site
Hey,
If I want to sum based on one of TWO specific text strains: Ex - "KTE" OR "ABC", would that be possible?
This comment was minimized by the moderator on the site
Hello, Adam,To sum the values based on more specifc text, any of the following formulas can do you a favor.=SUMIF(A2:A7, "*KTE*", B2:B7)+SUMIF(A2:A7, "*ABC*", B2:B7)
=sum(filter(B2:B7, regexmatch(A2:A7, "KTE")))+sum(filter(B2:B7, regexmatch(A2:A7, "ABC")))
please try, hope it can help you!
This comment was minimized by the moderator on the site
Hi,

the sum if formular is really useful. However, do you know how to make the text string dynamic (meaning referring to a cell)?

E.g. "*KTE*" replaced with something like C2 if the text string is in column C already.

=sumif(A2:A9,"*KTE*",B2:B9).
This comment was minimized by the moderator on the site
Hi, Sunith,
To replace the specific text with cell reference, please apply the below formula, change the cell C2 to your need.
=sumif(A2:A9,"*"&C2&"*",B2:B9)

Please try, thank you!
This comment was minimized by the moderator on the site
It works - thank you!
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations