如何在excel中求和(+)和否定( - )数字

时间:2022-09-29 00:17:08

I have a Excel question. How do I sum the numbers in a column which has -1, 1, -2, 3, 1 in a way that it shows me two separate results? Here is the example of my desired ouput:

我有一个Excel问题。如何将具有-1,1,-2,3,1的列中的数字相加,以便显示两个单独的结果?这是我想要的输出的例子:

week    az  ca  tx  
week1   1    3   1
week2  -1   -1  -2
week3   1   -1   1

win     2    3   2
loss    1    2   2

i tried to use the auto sum in Excel but it gives me something like this:

我试图在Excel中使用自动求和,但它给了我这样的东西:

win     1    1   0

could someone with Excel (does not mater what version) expertise help please? i tried the =if(true value, and false but it does not work)

有人可以使用Excel(不是什么版本)专业知识帮助吗?我尝试了= if(真值,但是它不起作用)

Thanks a lot. Joey

非常感谢。乔伊

1 个解决方案

#1


1  

You could use the sumif function to sum only positive or negative numbers.

您可以使用sumif函数仅对正数或负数求和。

For the wins:

胜利:

=SUMIF(B2:B4, ">0")

For the loses:

为了输?

=-1 * SUMIF(B2:B4, "<0")

#1


1  

You could use the sumif function to sum only positive or negative numbers.

您可以使用sumif函数仅对正数或负数求和。

For the wins:

胜利:

=SUMIF(B2:B4, ">0")

For the loses:

为了输?

=-1 * SUMIF(B2:B4, "<0")