Excel function — SUMPRODUCT usage (1), too powerful

The SUMPRODUCT function is mainly used in the given groups of arrays, and then multiplies the corresponding elements between the arrays, and finally returns the sum of the products. It can be seen literally that SUMPRODUCT consists of two English words, sum is sum and product is Product, so it means the sum of products.

The last article introduced you to the usage of PRODUCT, and today I will introduce you to the usage of SUMPRODUCT function

SUMPRODUCT function function

SUMproduc first calculates the product between the elements of multiple arrays and then sums them up

SUMPRODUCT function syntax

SUMPRODUCT(array1,array2,array3, …)Array is an array

Parameter Description

array: Specify the array or cell range that contains the values ​​that constitute the calculation object

Precautions for using the SUMPRODUCT function

(1). The array parameters must have the same dimension, otherwise, the function SUMPRODUCT will return the error value #VALUE!

(2). The data area reference cannot be quoted in the whole column. For example: A:A, B:B

(3). Treat non-numeric array elements as 0

(4). The data area is not large, you can use the sumproduct function, otherwise, the calculation speed will become very slow

(5) For sumproduct function, each parameter separated by comma must be numeric data,

If it is the logical value of the result of the judgment, it is necessary to multiply by 1 and convert it into a number. If you do not use a comma, you can connect directly with a sign, which is equivalent to a multiplication operation, and you do not need to add 1.

The classic example of the SUMPRODUCT function is as follows:

  1. When the parameters in the sumproduct function are two arrays, all elements of the two arrays are multiplied correspondingly.

Enter in cell C2:

= SUMPRODUCT (A2: A4, B2: B4)

In fact, the calculation principle of the above formula is as follows:

=14+25+3*6

Insert picture description here

Examples of commonly used methods of SUMPRODUCT function:

①. Single condition summation------calculate the sum of sales in Shandong area

Enter in cell F2:

=SUMPRODUCT((B2:B16="Shandong")*(C2:C16))

Insert picture description here

You may have doubts when you see this formula, it seems to be different from the syntax format, but in fact it is regarded as having only one parameter. Because when a logical array composed of TRUE and FALSE appears in the function, the formula should be written in this format =SUMPRODUCT((B2:B16="Shandong")*1, (C2:C16)), multiply by 1, and It can be converted into an array to participate in operations. Otherwise, write it in the top form.

Formula decomposition

=sumproduct({Array 1}*{Array 2})

=sumproduct({TRUE;……TRUE}*{332;…183})

=1332+1183=515。

②. Multi-condition summation------calculate the sum of sales in Shandong and Anhui
. Enter in cell F8:

=SUMPRODUCT(((B2:B16="Shandong")+(B2:B16="Anhui")),(C2:C16))

Insert picture description here

③. Multi-condition summation------calculate the sum of the sales volume of the second group in Shandong area
Enter in cell H2:

=SUMPRODUCT((B2:B16="Shandong") (C2:C16="Group Two") (D2:D16))

Insert picture description here

note:

Through multi-condition summation, we can see the following laws:

SUMPRODUCT (Condition 1 Condition 2 Condition 3…*Condition N)*: All conditions are met

SUMPRODUCT (Condition 1+Condition 2+Condition 3...+Condition N) +: satisfy any condition

Thank you for watching. See you in the next issue. If you have any questions, please leave a message in the comment area or send a private message to us

If you are interested in the excel function formulas, you can follow us. Before the course is updated, you can take a look at our previous courses.

Have you learnt that?

Want to learn more function knowledge, welcome to pay attention to forwarding
Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_43152686/article/details/109155089