Site icon ExcelNotes

How to Sum Even Numbers

Even numbers are divisible by two. When an even number is divided by two, the reminder returns zero. You can use the MOD and SUMPRODUCT functions to count the number of even numbers.

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 the Even Numbers in Column C?

=SUMPRODUCT(–(MOD(C2:C10,2)=0),C2:C10)

The result returns -$3,404. There are four even numbers in column C: C6($0), C7(-$2,604), C9(-$800) and C10($0).

Explanation:

AmountStep 1Step 2Step 3
$782.030.03FALSE0
$23.001FALSE0
$576.740.74FALSE0
-$163.001FALSE0
$0.000TRUE1
-$2,604.000TRUE1
$56.780.78FALSE0
-$800.000TRUE1
$0.000TRUE1

You can add up the numbers in one column if the corresponding cell in another column is an even number.

Question: What is the Sum in Column B if the corresponding cells in Column C are Even Numbers?

=SUMPRODUCT(–(MOD(C2:C10,2)=0),B2:B10)

The result returns 1,800. There are four even numbers in column C, and the corresponding cells in column B are B6 (300), B7 (200), B9 (800), and B10 (500).

Explanation:

Notes: The SUMPRODUCT Function

The SUMPRODUCT function adds all the multiplication results for all arrays.

Formula:

=SUMPRODUCT(array1, [array2], …)

Explanations:

– Array1 is required; the first array is to multiply and add.
– Array2 is optional; the second array is to multiply and add.

Exit mobile version