Tip: Other languages are Google-Translated. You can visit the English version of this link.
or

Register

or

## How to sum values based on text criteria in Excel?

In Excel, have you ever tried to sum values based on another column of text criteria? For example, I have a range of data in worksheet as following screenshot shown, now, I want to add up all the numbers in column B corresponding with the text values in column A that meet a certain criterion, such as sum the numbers if the cells in column A contains KTE.

 Advanced Combine Rows:(Combine duplicate rows and sum / average corresponding values): 1. Specify the key column that you want to combine other column based on; 2. Choose one calculation for your combined data. Kutools for Excel: with more than 200 handy Excel add-ins, free to try with no limitation in 60 days.

#### Sum the values based on another column if contains certain text

###### Save 50% of your time, and reduce thousands of mouse clicks for you every day!

Let’s take the above data for example, to add all the values together which contains the text “KTE” in column A, the following formula may help you:

Please enter this formula =SUMIF(A2:A6,"*KTE*",B2:B6) into a blank cell, and press Enter key, then all the numbers in column B where the corresponding cell in column A contains text “KTE” will add up. See screenshots:

Tip: In the above formula, A2:A6 is the data range which you add the values based on, *KTE* stands for the criteria you need, and B2:B6 is the range you want to sum.

#### Sum the values based on another column if starts with certain text

If you just want to sum the cell values in column B where the corresponding cell in column A which text starts with “KTE”, you can apply this formula: =SUMIF(A2:A6,"KTE*",B2:B6), see screenshots:

Tip: In the above formula, A2:A6 is the data range which you add the values based on, KTE* stands for the criterion you need, and B2:B6 is the range you want to sum.

#### Sum the values based on another column if ends with certain text

To add up all the values in column B where the corresponding cell in column A which text ends with “KTE”, this formula can do you a favor: =SUMIF(A2:A6,"*KTE",B2:B6), (A2:A6 is the data range which you add the values based on, KTE* stands for the criterion you need, and B2:B6 is the range you want to sum)see screenshots:

#### Sum the values based on another column if only is certain text

If you just want to sum the values in column B which corresponding cell content only is “KTE” of column A, please use this formula: =SUMIF(A2:A6,"KTE",B2:B6), (A2:A6 is the data range which you add the values based on, KTE stands for the criterion you need, and B2:B6 is the range you want to sum) and then only the text is “KTE” in column A which relative number in column B will add up, see screenshots:

Related articles:

How to sum every n rows down in Excel?

How to sum cells with text and numbers in Excel?

### Kutools for Excel Helps You Always Finish Work Ahead of Time, and Stand Out From Crowd

• More than 300 powerful advanced features, designed for 1500 work scenarios, increasing productivity by 70%, give you more time to take care of family and enjoy life.
• No longer need memorizing formulas and VBA codes, give your brain a rest from now on.
• Become an Excel expert in 3 minutes, Complicated and repeated operations can be done in seconds,
• Reduce thousands of keyboard & mouse operations every day, say goodbye to occupational diseases now.
• 110,000 highly effective people and 300+ world-renowned companies' choice.
• 60-day full features free trial. 60-day money back guarantees. 2 years of free upgrade and support.

### Brings Tabbed Browsing and Editing to Microsoft Office, Far More Powerful Than The Browser's Tabs

• Office Tab is designed for Word, Excel, PowerPoint and Other Office Applications: 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!
Say something here...
symbols left.
###### or post as a guest, but your post won't be published automatically.
• To post as a guest, your comment is unpublished.
· 28 days ago
I create a dynamic string which contains the cells to sum and pass this string to sum function and it gives me #value error. Any solution to this.
• To post as a guest, your comment is unpublished.
· 8 days ago
Hi, Desu,
Could you give your problem more detailed, thank you!
• To post as a guest, your comment is unpublished.
· 1 months ago
By the way, I’m using the =SUMIF(A2:A6,"*KTE*",B2:B6) formula, and I want to do more than just the B column (up to column AM).
• To post as a guest, your comment is unpublished.
· 8 days ago
Hello, Paige,
For solving your problem, may be there is no simple formula, you should join the SUMIF function together to get the result as you need, for example, you can use the below formula: (you can add other columns data with combining the sumif function)

=SUM(SUMIF(A2:A6,"*kte*",B2:B6), SUMIF(A2:A6,"*kte*",C2:C6), SUMIF(A2:A6,"*kte*",D2:D6))