To sum only positive numbers in Excel, use the SUMIF function. The SUMIF function adds the values in a range that meet a specific condition.
Steps to sum only positive numbers
-
Select the cell where you want the sum to appear.
-
Enter the formula:
-
range is the group of cells you want to check.
-
">0" is the condition, which ensures only numbers greater than zero are summed.
-
Press Enter.
Example
Suppose you have the following values in cells A1 to A5:
| A |
|---|
| 10 |
| -5 |
| 7 |
| -2 |
| 15 |
Using the formula:
=SUMIF(A1:A5, ">0")
The result will be 32 because only 10, 7, and 15 are summed.
Alternative using SUMPRODUCT
Another method is using SUMPRODUCT:
=SUMPRODUCT((A1:A5>0)*A1:A5)
This multiplies each value by 1 if it is positive, then sums them. The result is the same (32).
Notes
-
The SUMIF function works identically on Windows and Mac versions of Excel.
-
Negative numbers and zero are ignored in the sum.
-
This method is useful when dealing with financial statements, sales reports, or any dataset where only gains or positive contributions need to be totaled.