Excel SUMPRODUCT FunctionWhen analyzing large chunks of Excel data, you often need to count cells based on the criteria provided or find the sum after multiplying the numbers. Microsoft Excel has a special function to achieve this, the SUMPRODUCT Function, and it is a case-sensitive function that compares two strings and returns Boolean True or False. In this tutorial, we will have a closer look at the SUMPRODUCT function and will learn the step-by-step procedure to apply this function in your Excel worksheet. What is SUMPRODUCT Function?The Excel SUMPRODUCT function returns the sum after multiplying numbers in an array, and it can also be used to count cells based on the criteria provided. This function is incredibly versatile and can also be used to count and sum your data, unlike the functions COUNTIFS or SUMIFS, but with more flexibility. You can easily extend the functionality of this function by combing it with other functions with SUMPRODUCT or inserting other functions inside SUMPRODUCT. Though initially, the SUMPRODUCT function might seem harder, complex, and even pointless. But this function is an extremely versatile function with several uses. One of the reasons for using this function is that it will handle arrays smoothly, and you can utilize it to process ranges of cells in quick, elegant ways. This function is categorized under Excel Math functions. SyntaxParameterArray1 (required): This parameter represents the range of cells which first need to be multiplied and then summed. Array2 and so on..(optional): This argument represents the second array (or more arrays) or range to multiply and then summed. ReturnThis function returns the sum after multiplying numbers in an array. Points to Remember
ExamplesExample1: Use SUMPRODUCT function to calculate total cost faced by the superstore.
Follow the below steps to use SUMPRODUCT function in your Excel worksheet: STEP 1: Insert a helper row Add a helper row beneath your Excel table named with "Total cost". It will look similar to the below image: In the helper row, we will type the SUMPRODUCT function and calculate the cost faced by the superstore. NOTE: As the above image shows, we have formatted the row with borders and font to make the worksheet more visually attractive.STEP 2: Insert the SUMPRODUCT formula The next step is to enter the formula so put your cursor in the second row of your helper column start typing: = SUMPRODUCT( It will look similar to the below image: STEP 3: Add the parameters
It will look similar to the below image:
It will look similar to the below image: STEP 4: SUMPRODUCT will return the result SUMPRODUCT (D4:D9, E4: E9) will calculate the total cost faced by the superstore and return the sum value after multiplying numbers in an array. It will look similar to the below image: Explanation of above formula Let's understand the mechanism (in terms of maths) with which the SUMPRODUCT works:
In mathematical terms, the SUMPRODUCT formula executes the given-below operation: Just imagine how important this function could be if your excel worksheet contains hundreds or thousands of rows! Example 2: Use SUMPRODUCT function to count total number of Perishable items and its cost.
Follow the below given steps to count the total number of perishable items (where Perishable = YES) and its cost in the above table using Excel SUMPRODUCT function: STEP 1: Insert two helper row Add two helper rows beneath your Excel table one named with "Total Perishable items" and another named with "Cost for Perishable items". It will look similar to the below image:
NOTE: As the above image shows, we have formatted the row with borders and font to make the worksheet more visually attractive.STEP 2: Insert the SUMPRODUCT formula to find count of perishable items
So our formula becomes: =SUMPRODUCT(--(C5:C10="YES")) NOTE: Using two minus signs (--) in Excel, return the value of "TRUE" into 1 and "False" into 0.
STEP 3: Insert the second SUMPRODUCT formula to find the cost of perishable items
It will look similar to the below image: STEP 4: SUMPRODUCT will return the result SUMPRODUCT (--(C4:C9="YES"),D4:D9) will calculate the cost of the perishable items and return the sum value after multiplying numbers in an array. The output will be $2,669. Refer to the below image: Example 3: Using the SUMPRODUCT function calculate the product (soft toys) details from the below given table and find its revenue for the year.
As shown in the above table, we have two values named with soft toys with the only difference that one is in lowercase (soft toys) and the other value in uppercase (SOFT TOYS). But we want the lowercase data value "soft toys". However, there are other Excel functions such as VLOOKUP and INDEX/MATCH to look for the given values, but the only problem is that it is not case-sensitive. So, we will use a combination of "SUMPRODUCT + EXACT" to achieve a case-sensitive lookup. Follow the below-given steps to product details and revenue for soft toys: STEP 1: Insert a helper row named "soft toys revenue" Place your cursor anywhere under products table and type the row name "soft toys revenue" on top of the cell. It will look similar to the below image: In the helper column, we will type the combination of the SUMPRODUCT + EXACT function to find the revenue details. STEP 2: Insert the SUMPRODUCT formula
It will look similar to the below image: NOTE: Excel SUMPRODUCT function returns the sum after multiplying numbers in an array, and it can also be used to count cells based on the criteria provided. This function takes arrays as its parameters.
Refer to the below image: STEP 3: Insert the EXACT function as the first parameter of SUMPRODUCT
It will look similar to the below image: STEP 4: Insert the second parameter of SUMPRODUCT Enter the revenue range as the second parameter of SUMPRODUCT. Here, cell range C4:C6 holds the revenue range. So our formula becomes: =SUMPRODUCT(--(EXACT(B5,B4:B6)),C4:C6). It will look similar to the below image: STEP 5: Combination of Excel SUMPRODUCT and EXCAT function will return the result EXACT will return the output for the formula after running a test on the values in column B, convert the TRUE/FALSE (output of the EXACT function) to 1's and 0's. As shown below, using the combination of SUMPRODUCT and EXACT, you will have the revenue for 'soft toys' product. It will look similar to the below image: Eureka! Now you have successfully covered all the steps and examples for the SUMPRODUCT function. Go ahead, use it whenever you need to do any comparison, combine it with other functions and fetch satisfactory results. Next TopicCustom Number Format in Excel |