Function Problems

Sum Cells by Matching Text and Format SUMIFS Results in Excel

Muhammad TalhaMuhammad Talha Nov 18, 2026 868 views

Question details

Sum values whose immediately preceding cells contain a specified label, and format cells containing a SUMIFS formula with a positive result.

Sum Cells by Matching Text and Format SUMIFS Results in Excel
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.
Before you start

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.

Solution 1Recommended

Use SUMIF and a formula-based conditional formatting rule

Sum values beside the matching label, then highlight positive results from formulas containing SUMIFS.

1
Enter the conditional sum

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.

2
Select the formatting range

Select the cells you want to format. For example, select R1:R100 if R1 is the top-left cell of the range.

3
Create the rule

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.

4
Choose a format

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.

Use SUMIF and a formula-based conditional formatting rule
Formula check: The rule searches the formula text for SUMIFS( and suppresses errors for cells without formulas. It can also match that text inside a quoted string, so review unusual formulas if needed. The SUMIF formula itself will not meet this SUMIFS formatting rule.
WPS Spreadsheets

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. 1. Open the workbook: Open your Excel workbook in WPS Spreadsheets and locate the row containing the labels and values.
  2. 2. Add the sum formula: Select an empty cell outside column Q and enter =SUMIF(F602:O602,"Garvit recovered cell",G602:P602).
  3. 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. 4. Apply and check the format: Choose a format, save the rule, and check that positive SUMIFS results in the selected range are highlighted.
Sum values aligned with a matching text labelHighlight positive SUMIFS results with conditional formattingOpen and edit Microsoft Excel XLSX and XLS filesWork in a familiar spreadsheet interface
microsoft office alternative - wps office

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.