Function Problems

Use SUMIFS in Excel to Sum Costs When Cells Contain Text

Anum MushtaqAnum Mushtaq Nov 25, 2026 870 views

Question details

Find cells containing assembly B among multiple assembly values and sum their corresponding costs.

Use SUMIFS in Excel to Sum Costs When Cells Contain Text
Product
Microsoft Excel
Device & OS
not provided
Scenario
Column A contains assembly values such as A B C, and column C contains the costs to total.
Observed behavior
A SUMIF formula returns zero when it searches for an exact B but the assembly cells contain additional values.
Before you start

Check that the assembly values are in column A and the corresponding numeric costs are in column C. If your columns differ, adjust the formula ranges to match your worksheet.

Solution 1Recommended

Sum costs for cells containing B with a SUMIFS wildcard

Use this formula when B can appear anywhere within an assembly cell.

1
Select an empty cell

In Excel, click an empty cell outside the cost column where you want to display the total.

2
Enter the SUMIFS formula

Type =SUMIFS(C:C,A:A,"*B*") and press Enter. The asterisks match any text before or after B, and SUMIFS adds the corresponding values in column C.

3
Add another condition if needed

If column B must also contain widget, use =SUMIFS(C:C,A:A,"*B*",B:B,"*widget*"). Omit this condition if no rows need to be filtered by column B.

Sum costs for cells containing B with a SUMIFS wildcard
Check for unintended matches: The criterion *B* matches B anywhere in a cell, including within other words. Each matching row's cost is added once, even if B appears more than once in that cell.
Try it in WPS Office

Sum costs containing an assembly value in WPS Spreadsheets

Open your workbook in WPS Spreadsheets and use the same SUMIFS wildcard formula to total costs for cells containing B.

  1. 1. Open the workbook: Open WPS Spreadsheets and select File > Open to choose your Excel workbook.
  2. 2. Select a result cell: Click an empty cell outside column C where the total should appear.
  3. 3. Enter the formula: Type =SUMIFS(C:C,A:A,"*B*") and press Enter to total the matching costs.
  4. 4. Save the workbook: Select File > Save or Save As to keep the formula in your workbook.
Find assembly text within cells using SUMIFS wildcardsCompatible with Microsoft Excel XLS and XLSX filesWork with formulas in a familiar spreadsheet interface
microsoft office alternative - wps office

Frequently Asked Questions

Why does a criterion of B return zero?

A criterion of "B" matches a cell containing B rather than a cell containing additional text such as A B C. Use "*B*" to match B anywhere in the cell.

Can I search for a value stored in another cell?

Yes. If the search value is in E1, enter =SUMIFS(C:C,A:A,"*"&E1&"*") to sum costs for cells containing that value.

Is the SUMIFS text match case-sensitive?

No. SUMIFS text criteria are not case-sensitive, so "*B*" also matches lowercase b.

Why might a matching row's cost not be included?

Check that the cost in column C is stored as a number and that the assembly and cost ranges refer to corresponding rows. SUMIFS does not add costs stored as text.