How to Sum Values for Repeated Text Matches in Excel
Question details
The user needs to calculate an overall total by searching a large table for repeated subject names and summing their corresponding values.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Calculating overall progress from a data table containing multiple entries for the same subject.
- Observed behavior
- Matching a specific text string across a designated range and returning the total sum of adjacent numerical values.
Ensure your source data range is consistent and that the text you want to match has no hidden trailing spaces, as this can cause the formula to miss matches.
Use the SUMIF Function to Sum Matching Values
The SUMIF function is the most efficient method to add up values based on a single text criteria, such as repeated subject names.
The SUMIF formula evaluates a specified range of cells, searches for a criteria you define, and then sums the values in a corresponding range.
Click on the cell where you want the total sum to be displayed (for example, P9).
Type the formula =SUMIF($B$6:$L$400,O9,$C$6:$M$400). In this formula, $B$6:$L$400 is the range being searched, O9 contains the text to match, and $C$6:$M$400 is the range of values to sum.
Ensure you use dollar signs ($) to lock the search and sum ranges. This prevents the range from shifting when you copy the formula down to other rows.
Press Enter to calculate the result, then drag the fill handle down to apply the calculation to other repeated text matches.

Calculate Data Faster with WPS Spreadsheet
WPS Spreadsheet fully supports the SUMIF function and provides an intuitive interface for managing large datasets. Easily sum up repeated text values and track overall progress without lag.
- 1. Open your data in WPS: Launch WPS Spreadsheet and open your workbook containing the data.
- 2. Use the Formula tab: Navigate to the Formula tab on the top ribbon and click 'Insert Function'.
- 3. Search for SUMIF: Type 'SUMIF' into the search box, select it from the list, and click OK.
- 4. Input the arguments: Enter your Range, Criteria, and Sum_range in the dialog box prompts, then click OK to calculate.

Frequently Asked Questions
What is the difference between SUMIF and SUMIFS?
SUMIF is used when you need to sum values based on a single condition, such as matching one subject name. SUMIFS allows you to sum values based on multiple conditions across different ranges.
Why is my SUMIF formula returning a 0?
This usually happens if the text in your criteria doesn't exactly match the text in the searched range. Check for typos, hidden characters, or trailing spaces in your cells. Using the TRIM function can help clean your text data.
Can I use partial text matches in a SUMIF formula?
Yes, you can use wildcards. For example, using "*Math*" as your criteria will sum all values where the text contains the word 'Math', regardless of what comes before or after it.
Do the range and sum_range need to be the same size?
Yes, for the SUMIF function to calculate correctly and prevent unexpected results, the criteria range and the sum range must be exactly the same size and shape.




