将 Excel 中的所有正数相加

发布于 2024-08-08 20:17:29 字数 134 浏览 4 评论 0原文

有没有办法将行/列中的所有正数相加,但忽略所有负数?与 SUM() 类似,只不过它忽略负数。我必须使用VBA吗?如果是这样,我该如何在VBA中做到这一点?

如果在 Excel 中无法完成,可以在 OpenOffice Calc 中完成吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

临走之时 2024-08-15 20:17:29

使用 SUMIF。 Y对 A 列中的所有正数求和:

=SUMIF(A:A,">0")

Excel 和 Calc 中存在相同的函数

Use SUMIF. YTo sum all the positive numbers in Column A:

=SUMIF(A:A,">0")

Same function exists in Excel and Calc

离不开的别离 2024-08-15 20:17:29
=SUMIF(A1:A99,">0")
=SUMIF(A1:A99,">0")
寒江雪… 2024-08-15 20:17:29

当然是这样的:

=SUMIF(B1:B50,">0")

这会将单元格 B1 到 B50 中的所有正数相加。

Sure like this:

=SUMIF(B1:B50,">0")

This will add all positive numbers in cells B1 to B50.

北风几吹夏 2024-08-15 20:17:29

=SUMIF(A1:A4,">=0")

=SUMIF(A1:A4,">=0")

满栀 2024-08-15 20:17:29

SUMIF() 可以解决这个问题:

 =SUMIF(A1:A100,">0")

您也可以使用数组公式,但这更复杂,并且比 SUMIF() 没有任何好处

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()

℡Ms空城旧梦 2024-08-15 20:17:29

获取辅助行/列,如有必要,在另一个选项卡中用 =if(A5>0;A5;0) 填充它们。这会将负数变成零。然后将这些相加。

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.

苏佲洛 2024-08-15 20:17:29

我是一个优秀的菜鸟......经过一个小时左右的时间想知道我做错了什么以及为什么它对我不起作用,我意识到每个符号是多么重要。这个公式应该有分号而不是逗号。一旦我改变了公式就没有给我任何错误
=sumif(A:A;">0")
希望这有帮助

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文