# SUMPRODUCT Function with Multiple Columns in Excel (4 Simple Ways)

SUMPRODUCT function is one of the most powerful array functions in Microsoft Excel that can pull out data from an array based on the criteria along multiple columns & rows. In this article, youâ€™ll learn how to use this SUMPRODUCT function efficiently with multiple columns under a number of criteria.

## Introduction to SUMPRODUCT Function

Before getting down to the uses of the SUMPRODUCT function, letâ€™s have a look at first how this function works.

• Syntax:

=SUMPRODUCT(array1,[array2],[array3],â€¦)

• Function:

Returns the sum of the products of corresponding ranges or arrays.

• Example:

In our example below, there are two columns comprising of unit & cost per unit of some materials. With SUMPRODUCT function, we can easily find out the total cost for all units. To do this, we have to type in Cell C7:

`=SUMPRODUCT(B3:B6*C3:C6)`

After pressing Enter, youâ€™ll get the total cost at once for all products.

Inside the SUMPRODUCT function, weâ€™re technically multiplying all units from Column B with the related costs per unit from Column C. SUMPROUCT function will then return by summing up all the products.

## 4 Suitable Approaches to Use SUMPRODUCT with Multiple Columns

### 1. Using SUMPRODUCT with Multiple Columns under AND Logic Criteria

Now weâ€™ll deal with our actual dataset where 3 columns are present with computer brands, device categories & sales price for each. In our first application with SUMPRODUCT function, weâ€™ll find out the total sales price of Lenovo notebook from the table data.

đź“Ś Steps:

âž¤ Select Cell G15 & type:

`=SUMPRODUCT((B5:B27=G12)*(C5:C27=G13)*(D5:D27))`

âž¤ Press Enter & youâ€™ll get the result at once.

So how this function works, right? With B5:B27=G12 & C5:C27=G13 inside the function, weâ€™re defining the brand & device names & D5:D27 is the output range that will return based on the brand & device criteria.

With SUMPRODUCT function, we can also extract the total counts of Lenovo notebook or any other category from the table.

đź“Ś Steps:

âž¤ Select Cell G18 & type:

`=SUMPRODUCT(--(B5:B27=G12),--(C5:C27=G13))`

âž¤ Press Enter & youâ€™ll see the result right away.

In this case, weâ€™re using logic arguments inside the SUMPRODUCT function. Weâ€™re asking the function to determine if the selected criteria match with the cell values in Column B & C. Uses of Double-Unary(â€“) before the arguments will convert the logical text values (TRUE or FALSE) into 1 or 0. And then SUMPRODUCT will sum up those number values to display the final result.

### 2. Using SUMPRODUCT with Multiple Columns under OR Logic Criteria

Now weâ€™ll assign OR logic in our criteria. Weâ€™ll determine the total sales price of Lenovo notebook & desktop.

đź“Ś Steps:

âž¤ In Cell G15, our formula based on the criteria will be:

`=SUMPRODUCT((B5:B27=G11)*((C5:C27=G12)+(C5:C27=G13))*(D5:D27))`

âž¤ Press Enter & the total sales price will be displayed as well.

If we want to count the presence of Lenovo devices in the table, then the device criteria will have to be added by inserting a Plus(+) between those two criteria.

đź“Ś Steps:

âž¤ In Cell G18, the formula will be:

`=SUMPRODUCT(--(B5:B27=G11),--((C5:C27=G12)+(C5:C27=G13)))`

âž¤ Press Enter & the function will return as 4.

### 3. Using SUMPRODUCT along Multiple Columns & Rows

SUMPRODUCT is one of the most useful functions that can extract data or do complex calculations by scrutinizing all mentioned criteria along rows & columns from an array. In our following & new dataset, the sales of computer devices of different brands are present based on the months. Weâ€™ll find out the number of sales for HP notebooks in January.

đź“Ś Steps:

âž¤ In Cell L11, we have to type:

`=SUMPRODUCT(D5:I14,(C5:C14=C10)*(D4:I4=L9)*(B5:B14=L7))`

âž¤ Press Enter & youâ€™ll get the total counts instantly under our criteria.

If you look carefully inside the function, weâ€™ve selected the entire array of sales data first. Then weâ€™ve added the criteria along 2 columns & a row. SUMPRODUCT function has then looked for our criteria in the selected array & returned with the final result by summing up all extracted data.

### 4. Inserting SUM Function inside SUMPRODUCT to Calculate Weighted Average

By combining SUMPRODUCT & SUM functions together, we can determine the weighted values for a range of data. The following dataset represents a studentâ€™s final exam marks along with the assigned weights of a number of subjects. Weâ€™ll calculate the weighted average marks of the student.

đź“Ś Steps:

âž¤ The formula to find the weighted average in Cell F8 will be:

`=SUMPRODUCT(C5:C11*D5:D11)/SUM(D5:D11)`

âž¤ Press Enter & youâ€™ll get the weighted average marks at once.

So here SUMPRODUCT function sums up all the products of marks & assigned weights. Then the calculated result will be divided by the summation of all assigned weight percentages.

## Concluding Words

I hope, this article on the uses of SUMPRODUCT function along multiple columns will now prompt you to apply in your regular Excel chores. If you got any questions or suggestions let me know through comments. You can check out our other interesting articles related to Excel functions on this website.