How to Sum If Cells Contain Text in Excel
To sum cells that contain specific text in Excel, you can use the SUMIF function. The SUMIF function allows you to add up numbers based on specific criteria.
Here's how to use the SUMIF function to sum cells containing specific text:
- Open Excel and enter your data in the worksheet. Make sure you have a column with text and a column with numbers to be summed.
- Click on the cell where you want the sum to be displayed.
- Type the following formula:
=SUMIF(range, criteria, sum_range)
range
: This is the range of cells where you want to look for the specific text.criteria
: This is the text you want to look for in the range. You can use wildcards (* and ?) to search for partial matches. Put the text in double quotes (" ").sum_range
: This is the range of cells with numbers you want to sum.
For example, let's say you have a table with two columns: Column A contains the product names, and Column B contains their sales. You want to find the total sales for products containing the word "Phone".
Example
A | B |
---|---|
Phone A1 | 100 |
Phone B2 | 200 |
Tablet A1 | 150 |
Phone C3 | 300 |
Tablet B2 | 250 |
To sum the sales for products containing the word "Phone", you can use the following formula:
=SUMIF(A1:A5, "*Phone*", B1:B5)
This will search for the text "Phone" in the range A1:A5 and sum the corresponding sales in the range B1:B5. The result will be 600.
In this example, the formula is entered in cell C1. After entering the formula, press Enter, and Excel will display the result (600) in cell C1.