问题
Is there a way to add up all of the positive numbers in a row/column but ignoring all of the negative numbers? Like SUM(), except that it ignores negative numbers. Would I have to use VBA? If so, how would I do it in VBA?
If it can't be done in Excel, can it be done in OpenOffice Calc?
回答1:
Use SUMIF. YTo sum all the positive numbers in Column A:
=SUMIF(A:A,">0")
Same function exists in Excel and Calc
回答2:
=SUMIF(A1:A99,">0")
回答3:
Sure like this:
=SUMIF(B1:B50,">0")
This will add all positive numbers in cells B1 to B50.
回答4:
=SUMIF(A1:A4,">=0")
回答5:
SUMIF() will do the trick:
=SUMIF(A1:A100,">0")
You could also use an array formula, but that's more complicated and has no benefit over SUMIF()
回答6:
Get auxiliary row/colums, in another tab if necessary them fill them with =if(A5>0;A5;0). That will turn negatives to zero. Then sum those.
回答7:
I am an excel noob...and after an hour or so of wondering what I am doing wrong and why wont it work for me, I realize how important each symbol is. this formula should have a semicolon instead of comma. Once I changed that the formula didn't give me any errors =sumif(A:A;">0") hope this helps
来源:https://stackoverflow.com/questions/1596745/adding-up-all-the-positive-numbers-in-excel