Example: You are working with a worksheet with the product in column A, the amount in column B, and the profit/loss in column C.
Question: What is the sum of numbers in odd rows in column B?
The result returns 2,100.
- Step 1: ROW(B2:B10): To have the row number;
- Step 2: MOD(ROW(B2:B10),2): To have the remainder when the row number divides two. The remainder returns one when the odd row number divides two;
- Step 3: The SUMPRODUCT function returns the sum of the products of the new array and the range B2:B10.
You can use the following formula to have the sum of the numbers in column C in the odd rows.
The result returns -3,544.
Notes: The SUMPRODUCT Function
The SUMPRODUCT function adds all the multiplication results for all arrays.
=SUMPRODUCT(array1, [array2], …)
– Array1 is required; the first array is to multiply and add.
– Array2 is optional; the second array is to multiply and add.