SUMPRODUCT is one of the most important Excel functions and the best part about it is, you can modify it in several ways.

And, one of its powers which I have discovered recently is using it as “**SUMPRODUCT IF**”.

In short, a **Conditional SUMPRODUCT**.

As you know, you can use SUMPRODUCT to multiply and sum specified ranges or arrays.

But, with a conditional SUMPRODUCT you can you can multiply and sum those ranges which meet criteria.

And you know the best part, there is no need to use IF function for this. But first, let me tell you how I got this thing.

Today in this post, I'd like to share with you a problem and a simple way to use **SUMPRODUCTIF** to solve it.

So let's get started...

Yesterday, I got a mail from one of my subscribers.

She wanted to create a conditional statement with SUMPRODUCT and IF to get data from a table.

Here is the mail which I have received:

*Hey Puneet, I need your help. Is there any way to combine SUMPRODUCT IF? I have some data in a table and I want to get the product of two columns meeting criteria. Please help me out.*

Along with the mail, I got an Excel file from her with following components. You can download this file from here to follow along.

**Stock Data:**This table is a stock data which is stored in different stores of her company. It has the product name, units in stock and weight per unit.**Drop Down List:**A drop-down menu to select a product.

From this table, she wanted to get total quantity of a product (units X weight per unit) by selecting the drop down.

For example, if she selects “Pulses”, the total quantity in the cell should be total by multiplying units with quantity per unit.

Please note down, a product name is a condition here.

At that time, I was sure about one thing that to get the sum of the product of arrays or ranges we can use SUMPRODUCT.

But here, the game was to get the sum by multiplying total of units and quantity per unit only for the cells who meet criteria.

And, the formula we can use it:

=SUMPRODUCT(--(C7:C19=C2),E7:E19,F7:F19)

Now, when you select an entry from drop down list, this formula will only return the product for cells which meet criteria.

As you already know that SUMPRODUCT can work with arrays. So in above method, we have used three arrays to get the product of values.

The formula works in following way.

**1. Creating a Condition**

**First** of all, I have created an array to check a condition product name. It will check the values from the product column, return TRUE for the matched values and FALSE for else.

**2. Using Double Minus Sign**

Now, next thing is to convert TRUE-FALSE values into 0-1 so that we can use them in the calculation. So, that’s why I have used double minus sign before the first array.

**3. Multiplying Arrays**

After converting, TRUE-FALSE into 0-1 the array will look something like this. Here all the values where criteria is not met, we have zeros.

Remember when anything multiplies with zero it returns zero.

In this way, we get the product for only those cells where we have 1. In short, where the condition is met.

**Download this sample file from here** to learn more.

The best part about using this conditional SUMPRODUCT is you don’t have to use IF and all the calculation is in a single cell.

As I said SUMPRODUCT is one of the most powerful functions and this one best thing you can do with its powers.

Now tell me one thing.

**Have you ever tried using a condition in SUMPRODUCT before?**

Share your views with me in the comment section, I'd love to hear from you. And, don't forget to share this tip with your friends.

**Must Read Excel Tutorials**

- RANK IF: There is no function in Excel to rank values using a condition but we can use SUMPRODUCT to create a conditional ranking formula [...]
- Weighted Average in Excel: the best way is to use a formula by combining SUMPRODUCT and SUM functions [...]
- MAX IF: It's an array formula which you can use to find max value from a range with criteria [...]
- Wildcard Characters in Excel: These wildcard characters are all about searching/looking up for a text with a partial match. In Excel, the biggest benefit of these characters is [...]
- DATEDIF: Well, it’s a mystery that why Microsoft has hidden the DATEDIF Function from functions list [...]

- ratanak
- Puneet Gogia

- Chandeep
- Puneet Gogia

- Adrian Palmer
- Puneet Gogia

- Phil Barker
- Puneet Gogia

- Vishwanathan Nagarajan
- Puneet Gogia

- Ahmed Sheikh
- Puneet Gogia
- Ahmed Sheikh