Skip to content
Free Excel Tutorials
  • Home
  • Excel For Beginners
  • Excel Intermediate
  • Advanced Excel For Experts

Data Analysis

  • Excel Pie Chart
  • Reverse List in Excel
  • How to add Trendline to a chart in Excel
  • Excel Line Chart
  • How to create Checklist in Excel

References

  • Count rows with at least n matching values
  • How to retrieve first match between two ranges in Excel
  • How to use Excel TRANSPOSE Function
  • How to use Excel ROW Function
  • How to get relative row numbers in a range in Excel

Data Validations

  • Excel Data validation must contain specific text
  • Excel Data validation whole percentage only
  • How To Create Drop-down List in Excel
  • Excel Data validation must not contain
  • Excel Data validation no punctuation

Sum if cells contain specific text in Excel

by

This tutorial shows how to Sum if cells contain specific text in Excel using the example below;

Formula

=SUMIF(range,"*text*",sum_range)

Explanation

To sum if cells contain specific text, you can use the SUMIF function with a wildcard.

In the example shown, cell G6 contains this formula:

=SUMIF(C5:C11,"*t-shirt*",D5:D11)

This formula sums the amounts in column D when a value in column C contains “t-shirt”. Note that SUMIF is not case-sensitive.

How the formula works

The SUMIF function supports wildcards. An asterisk (*) means “one or more characters”, while a question mark (?) means “any one character”.

These wildcards allow you to create criteria such as “begins with”, “ends with”, “contains 3 characters” and so on.

To match all items that contain “t-shirt”, the criteria is “*t-shirt*”. Note that you must enclose literal text and the wildcard in double quotes (“”).

Alternative with SUMIFS

You can also use the SUMIFS function. SUMIFS can handle multiple criteria, and the order of the arguments is different from SUMIF. The equivalent SUMIFS formula is:

=SUMIFS(D5:D11,C5:C11,"*t-shirt*")

Notice that the sum range always comes first in the SUMIFS function.

Post navigation

Previous Post:

How to use Excel CHOOSE Function

Next Post:

Customize Ribbon In Excel

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Learn Basic Excel

Ribbon
Workbook
Worksheets
Format Cells
Find & Select
Sort & Filter
Templates
Print
Share
Protect
Keyboard Shortcuts

Categories

  • Charts
  • Data Analysis
  • Data Validation
  • Excel Functions
    • Cube Functions
    • Database Functions
    • Date and Time Functions
    • Engineering Functions
    • Financial Functions
    • Information Functions
    • Logical Functions
    • Lookup and Reference Functions
    • Math and Trig Functions
    • Statistical Functions
    • Text Functions
    • Web Functions
  • Excel VBA
  • Excel Video Tutorials
  • Formatting
  • Grouping
  • Others

Logical Functions

  • TRUE function: Description, Usage, Syntax, Examples and Explanation
  • How to use Excel AND Function
  • How to return blank in place of #DIV/0! error in Excel
  • Not Equal To ‘<>‘ operator in Excel
  • OR function: Description, Usage, Syntax, Examples and Explanation

Date Time

  • How to calculate nth day of year in Excel
  • How to get same date next year or previous year in Excel
  • Get days, hours, and minutes between dates in Excel
  • Assign points based on late time in Excel
  • Roll back weekday to Friday base on a particular date in Excel

Grouping

  • If cell contains one of many things in Excel
  • Group arbitrary text values in Excel
  • Categorize text with keywords in Excel
  • Map inputs to arbitrary values in Excel
  • Map text to numbers in Excel

General

  • Count cells that do not contain many strings in Excel
  • Basic numeric sort formula in Excel
  • Create dynamic workbook reference to another workbook in Excel
  • Lock Cells in a Worksheet Excel
  • Zoom Worksheet in Excel
© 2026 xlsoffice . All Right Reserved. | Teal Smiles | Abbreviations And Their Meaning