Sum Cells by Matching Text and Format SUMIFS Results in Excel
Question details
Sum values whose immediately preceding cells contain a specified label, and format cells containing a SUMIFS formula with a positive result.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A row contains labels and adjacent values, and column Q already contains another formula.
- Observed behavior
- The desired result is a sum of values beside the matching label and conditional formatting for positive SUMIFS formula results.
Confirm that F602:O602 contains the labels to check and that G602:P602 contains the corresponding values one column to the right. Choose an empty cell for the sum so you do not overwrite the existing formula in column Q.
Use SUMIF and a formula-based conditional formatting rule
Sum values beside the matching label, then highlight positive results from formulas containing SUMIFS.
Select an empty cell and enter =SUMIF(F602:O602,"Garvit recovered cell",G602:P602). Each cell in the sum range corresponds to the cell immediately to its left in the criteria range.
Select the cells you want to format. For example, select R1:R100 if R1 is the top-left cell of the range.
Go to Home > Conditional Formatting > New Rule > Use a formula to determine which cells to format. Enter =IFERROR(AND(R1>0,ISNUMBER(SEARCH("SUMIFS(",FORMULATEXT(R1)))),FALSE), replacing R1 with the top-left cell of your selected range.
Click Format, choose a fill or other style, and click OK to save the rule. Check the Applies to range in Conditional Formatting > Manage Rules.

Sum matching labels and highlight SUMIFS results in WPS Spreadsheets
Use SUMIF to add values beside matching labels, then create a formula-based conditional formatting rule for positive SUMIFS results.
- 1. Open the workbook: Open your Excel workbook in WPS Spreadsheets and locate the row containing the labels and values.
- 2. Add the sum formula: Select an empty cell outside column Q and enter =SUMIF(F602:O602,"Garvit recovered cell",G602:P602).
- 3. Set the formatting rule: Select the cells to format, then open Home > Conditional Formatting > New Rule and choose a formula-based rule. For a range starting at R1, enter =IFERROR(AND(R1>0,ISNUMBER(SEARCH("SUMIFS(",FORMULATEXT(R1)))),FALSE).
- 4. Apply and check the format: Choose a format, save the rule, and check that positive SUMIFS results in the selected range are highlighted.

Frequently Asked Questions
Why are the SUMIF ranges shifted by one column?
F602:O602 contains the labels to test, while G602:P602 contains the values immediately to their right. SUMIF pairs the ranges by position.
Will the SUMIF formula overwrite the formula in column Q?
Only if you enter it in an occupied cell in column Q. Select a different empty cell before entering the SUMIF formula.
Why isn't my positive SUMIF result highlighted?
The conditional formatting rule searches for SUMIFS( in the cell's formula text. A formula using SUMIF rather than SUMIFS does not meet that condition.
What if the formatting range starts somewhere other than R1?
In the conditional formatting formula, replace both R1 references with the top-left cell of the selected range. Check the range under Home > Conditional Formatting > Manage Rules.




