Excel SUMIF with Partial Match (3 Ways)

Sometimes we need to sum up values based on specific criteria in another cell. In this tutorial, you will learn to use the SUMIF function based on a partial match in Excel. We have included three different scenarios for a partial match in Excel. Those scenarios are a partial match at the beginning, at the ending, and at any position respectively. We will use only the SUMIF function throughout the whole article, to sum up, values based on a partial match in Excel.

📌 Related: How to Use SUMIF with Multiple Criteria in Excel (3 Methods)


Download Practice Workbook

You are recommended to download the Excel file and practice along with it.


The SUMIF Function: an Overview

You can use the SUMIF function, to sum up, values that meet specific criteria. For example, you want to add up all the values in a column that are greater than 20. In this case, you can easily sum up all the values by specifying the condition using the SUMIF function.

Syntax: 

SUMIF(range, criteria, [sum_range])

Arguments:

  • range: This field is mandatory. You will input the range of the cells that you want to sum up altogether.
  • criteria: This is also a mandatory field. Here, you will specify the condition based on which you want to perform the sum operation within a cell range. You can specify the conditions as follows: 20, “>20”, F2, “15?”, “Car*”, “*~?”, or TODAY().
  • sum_range: This field is optional. In this field, you will input the cell range that you want to include in your sum formula by excluding the cell range specified by the range argument.

3 Ways to Use the SUMIF Function Based on Partial Match in Excel

We will be using a Product Price List data table to demonstrate all the methods to use the SUMIF function based on a partial match in Excel.

sumif partial match in excel dataset

So, without having any further discussion let’s get into all the methods one by one.


1. Excel SUMIF: Partial Match at the Beginning

In this section, you will learn to sum only if you find a match at the beginning of a cell value.  For example, we want to sum up the values of only those products from the Product Price List data table, whose Product ID possesses “MTT” in them. Ok, let’s jump into the steps, for now, to see how it’s to be done.

🔗 Steps:

❶ First of all, select cell C16 ▶ to store the formula result.

❷ After that type the formula

=SUMIF($B$5:$B$13,"MTT*",$D$5:$D$13)
within the cell.

❸ Now hit the ENTER button.

Excel SUMIF: Partial Match at the Beginning

That’s it.

␥  Formula Breakdown: 

  • $B$5:$B$13 ▶ refers to the cell range of the Product ID column. Within this range, we will look for the keyword “MTT”.
  • “MTT*” ▶ this is the keyword to search that must be included at the beginning of the product ids.
  • $D$5:$D$13 ▶ this is the sum range. The summing operation is executed within this range.
  • =SUMIF($B$5:$B$13,"MTT*",$D$5:$D$13) ▶ returns the summation of the prices for only those products having the “MTT” keyword at the beginning of their Product IDs.

2. Excel SUMIF: Partial Match at the Ending

Now we will calculate the summation of the prices for only the products, that have the keyword “NPP” at the end of their Product IDs. Here are the steps to follow:

🔗 Steps:

❶ First of all, select cell C16 ▶ to store the formula result.

❷ After that type the formula

=SUMIF($B$5:$B$13,"*NPP",$D$5:$D$13)
within the cell.

❸ Now hit the ENTER button.

Excel SUMIF: Partial Match at the Ending

That’s it.

␥  Formula Breakdown: 

  • $B$5:$B$13 ▶ refers to the cell range of the Product ID column. Within this range, we will look for the keyword “NPP”.
  • “*NPP” ▶ this is the keyword to search that must be included at the end of the product ids.
  • $D$5:$D$13 ▶ this is the sum range. The summing operation is executed within this range.
  • =SUMIF($B$5:$B$13,"*NPP",$D$5:$D$13) ▶ returns the summation of the prices for only those products having the “NPP” keyword at the end of their Product IDs.

3. Excel SUMIF: Partial Match at Any Position

Finally, we are going to discuss a universal formula that can perform the sum operation based on the partial match at any position. For instance, you want to add the prices for only those products having the keyword “VX” in them at any position. Now all you can do is use the below formula specified in the second step.

🔗 Steps:

❶ First of all, select cell C16 ▶ to store the formula result.

❷ After that type the formula

=SUMIF($B$5:$B$13,"*"&C15&"*",$D$5:$D$13)
within the cell.

❸ Now hit the ENTER button.

That’s it.

␥  Formula Breakdown: 

  • $B$5:$B$13 ▶ refers to the cell range of the Product ID column. Within this range, we will look for the keyword “VX”.
  • “*”&C15&”*” ▶ here the cell address C15 holds the keyword “VX”. You can use cell C15 as a search box, where you can input any keyword to search for and then sum up the corresponding prices of them.
  • $D$5:$D$13 ▶ this is the sum range. The summing operation is executed within this range.
  • =SUMIF($B$5:$B$13,"*"&C15&"*",$D$5:$D$13) ▶ returns the summation of the prices for only those products having the “VX” keyword at any position of their Product IDs.

Things to Remember

📌 Beware of the position of the asterisk (*) in the criteria field.

📌 Make sure what range you are selecting for the range argument and what for the sum_range argument.


Conclusion

To wrap up, we have discussed 3 different methods to use the SUMIF function based on a partial match in Excel. You are recommended to download the practice workbook attached along with this article and practice all the methods with that. And don’t hesitate to ask any questions in the comment section below. We will try to respond to all the relevant queries asap.


Read More

Mrinmoy

Hi! This is Mrinmoy. I write about Excel and VBA stuff for Exceldemy. I have my graduation completed from Khulna University of Engineering & Technology, Bangladesh. I have an immense interest in Datascience and Machine Learning. I like to play guitar and watch Tedtalks in my leisure time. I used to be an indie filmmaker and a wedding photographer. I'm liberal to any kind of constructive criticism and inclined towards expanding my learnings.

We will be happy to hear your thoughts

Leave a reply

ExcelDemy
Logo