Function Problems

How to Sum Excel Values When Another Column Contains Specific Text

Ayan MasoodAyan Masood Nov 11, 2026 869 views

Question details

Calculate the total of numerical values in one column based on matching specific text criteria located in another column.

How to Sum Excel Values When Another Column Contains Specific Text
Product
Excel / WPS Spreadsheet
Device & OS
not provided
Scenario
Calculating conditional totals when handling data with categories, names, or repeated text values across multiple columns.
Observed behavior
Needs to calculate the sum of numbers in a specific range that correspond to matching text items in an adjacent or specified range.
Before you start

Ensure your text criteria and numerical data ranges are of equal length, and check for any accidental leading or trailing spaces in your text cells, as they can cause formula matching errors.

Solution 1Recommended

Use the SUMIF Function for a Single Text Criterion

The SUMIF function is the most direct way to sum numbers based on a single specific text match in another column.

The SUMIF syntax requires three arguments: the range containing the text to evaluate, the specific text criterion you are looking for, and the range containing the values to sum.

1
Select the destination cell

Click on the cell where you want the calculated total to appear.

2
Enter the SUMIF formula

Type =SUMIF(A2:A33, D2, B2:B33). In this example, A2:A33 is the column with the text, D2 contains the specific text you want to match, and B2:B33 is the column containing the numbers to sum.

3
Calculate and copy

Press Enter to calculate the result. If you have a list of different text criteria, click the bottom-right corner of the cell and drag the fill handle down to copy the formula for each item.

Use the SUMIF Function for a Single Text Criterion
Using Absolute References: If you are copying the formula down multiple rows, remember to lock your data ranges using absolute references (e.g., $A$2:$A$33) so the range does not shift.
Efficient Data Calculation in WPS Spreadsheet

Easily Sum Data Based on Text with WPS Office

WPS Spreadsheet fully supports SUMIF, SUMIFS, and PivotTables, allowing you to seamlessly calculate conditional totals exactly as you would in Microsoft Excel.

  1. 1. Open your workbook: Launch WPS Spreadsheet and open the file containing your data.
  2. 2. Start the formula: Click on the cell where you want the sum and type =SUMIF( to trigger the formula prompt.
  3. 3. Select ranges: Follow the on-screen formula hint to highlight your text criteria range, specify your criterion, and select your sum range.
  4. 4. Get results: Press Enter to get your conditional sum instantly.
100% compatible with Microsoft Excel formulas and functions (.xlsx).Intuitive formula builder and syntax hints to prevent data entry errors.Lightweight software with fast processing speeds for large datasets.Free built-in PivotTable feature for quick, drag-and-drop data summarization.
microsoft office alternative - wps office

Frequently Asked Questions

Can I use partial text matches with the SUMIF function?

Yes, you can use wildcard characters in your criteria. An asterisk (*) represents any sequence of characters, and a question mark (?) represents a single character. For example, using "*apple*" as your criterion will sum all values where the text contains the word "apple" anywhere in the cell.

Why is my SUMIF formula returning zero even though the text matches?

This usually happens due to hidden leading or trailing spaces in either your criteria cell or the text column itself. You can use the TRIM function on your source data to remove extra spaces, or verify that the text matches exactly.

Is the SUMIF function case-sensitive?

No, the SUMIF and SUMIFS functions are not case-sensitive. Searching for "Apple", "APPLE", or "apple" as your text criterion will yield the exact same sum result.

How do I sum values if the text is NOT equal to a specific word?

You can use the "not equal to" operator (<>) within your criterion. For example, to sum all values where the text in column A is not "Apples", you would use the formula: =SUMIF(A2:A33, "<>Apples", B2:B33).