Skip to main content

Sum if begins with or ends with specific text or characters

To sum values if corresponding cells begin with or end with a specific value, you can apply the SUMIF function with a wildcard (*) to pull it off. This article will introduce how to use the formula in details.


Sum values if corresponding cells begin with a specific value

To sum values if corresponding cells begin with a specific value, the normal SUMIF function can do you a favor, the generic syntax is:

=SUMIF(range,"text*",sum_range)
  • range: The range where the criteria (text*) is matched;
  • text*: The criteria you want to sum values based on. Here, the * wildcard is used to find any number of characters, to match all items that start with a specific text, put the * wildcard at the end of the text. (Note that you must enclose the text and wildcard in double quotes.)
  • sum_range: The range of cells with matched numeric values that you want to sum.

For example, here, I want to sum all sales of the items that start with the text “KTE”, please copy or enter any one of the below formulas into a blank cell, and then press Enter key to return the result:

=SUMIF(A2:A10,"KTE*",B2:B10)          (Type the criteria manually)
=SUMIF(A2:A10,D2&"*",B2:B10)         
(Use a cell reference)


Sum values if corresponding cells end with a specific value

Similarly, to sum values if corresponding cells end with a specific value, embed the * wildcard into the criteria with the SUMIF function. The generic syntax is:

=SUMIF(range,"*text",sum_range)
  • range: The range where the criteria (text*) is matched;
  • *text: The criteria you want to sum values based on. Here, the * wildcard is used to find any number of characters, to match all items that end with a specific text, put the * wildcard in front of the text. (Note that you must enclose the text and wildcard in double quotes.)
  • sum_range: The range of cells with matched numeric values that you want to sum.

In this example, I will sum all sales of the items that end with the character “S”, please use any one of the below formulas into a blank cell, and then press Enter key to return the result:

=SUMIF(A2:A10,"*S",B2:B10)                     (Type the criteria manually)
=SUMIF(A2:A10, "*"&D2,B2:B10)               
(Use a cell reference)

Note: This SUMIF function is not case-sensitive.


Relative function used:

  • SUMIF:
  • The SUMIF function can help to sum cells based on one criterion.

More articles:

  • Sum If Cells Contain Specific Text In Another Column
  • This tutorial will show you how to sum values if cells contain specific or partial text in another column. Take the below data range as an example, to get the total amounts of the products containing the text “T-Shirt”, both the SUMIF function and SUMPRODUCT function can deal with this task in Excel.
  • Sum Smallest Or Bottom N Values
  • In Excel, it is easy for us to sum a range of cells by using the SUM function. Sometimes, you may need to sum the smallest or bottom 3, 5 or n numbers in a data range as below screenshot shown. In this case, the SUMPRODUCT together with the SMALL function can help you to solve this problem in Excel.
  • Sum Smallest Or Bottom N Values Based On Criteria
  • In previous tutorial, we have discussed how to sum the smallest n values in a data range. In this article, we will perform a further advanced operation – to sum the lowest n values based on one or more criteria in Excel.

The Best Office Productivity Tools

Kutools for Excel - Helps You To Stand Out From Crowd

🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions
Popular Features: Find, Highlight or Identify Duplicates  |  Delete Blank Rows  |  Combine Columns or Cells without Losing Data  |  Round without Formula ...
Super VLookup: Multiple Criteria  |  Multiple Value  |  Across Multi-Sheets  |  Fuzzy Lookup...
Adv. Drop-down List: Easy Drop Down List  |  Dependent Drop Down List  |  Multi-select Drop Down List...
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  Compare Columns to Select Same & Different Cells ...
Featured Features: Grid Focus  |  Design View  |  Big Formula Bar  |  Workbook & Sheet Manager | Resource Library (Auto Text)  |  Date Picker  |  Combine Worksheets  |  Encrypt/Decrypt Cells  |  Send Emails by List  |  Super Filter  |  Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters ...)  |  50+ Chart Types (Gantt Chart ...)  |  40+ Practical Formulas (Calculate age based on birthday ...)  |  19 Insertion Tools (Insert QR Code, Insert Picture from Path ...)  |  12 Conversion Tools (Numbers to Words, Currency Conversion ...)  |  7 Merge & Split Tools (Advanced Combine Rows, Split Excel Cells ...)  |  ... and more

Kutools for Excel Boasts Over 300 Features, Ensuring That What You Need is Just A Click Away...

Description


Office Tab - Enable Tabbed Reading and Editing in Microsoft Office (include Excel)

  • One second to switch between dozens of open documents!
  • Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
  • Increases your productivity by 50% when viewing and editing multiple documents.
  • Brings Efficient Tabs to Office (include Excel), Just Like Chrome, Edge and Firefox.
Comments (0)
No ratings yet. Be the first to rate!
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations