Use SUMIFS in Excel to Sum Costs When Cells Contain Text
Question details
Find cells containing assembly B among multiple assembly values and sum their corresponding costs.

- 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.
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.
Sum costs for cells containing B with a SUMIFS wildcard
Use this formula when B can appear anywhere within an assembly cell.
In Excel, click an empty cell outside the cost column where you want to display the total.
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.
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 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. Open the workbook: Open WPS Spreadsheets and select File > Open to choose your Excel workbook.
- 2. Select a result cell: Click an empty cell outside column C where the total should appear.
- 3. Enter the formula: Type =SUMIFS(C:C,A:A,"*B*") and press Enter to total the matching costs.
- 4. Save the workbook: Select File > Save or Save As to keep the formula in your workbook.

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.




