Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to sum positive (+) and negative (-) number in excel

Tags:

excel

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:

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:

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)

Thanks a lot. Joey

like image 365
Joey Avatar asked Sep 03 '25 17:09

Joey


1 Answers

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

For the wins:

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

For the loses:

=-1 * SUMIF(B2:B4, "<0")
like image 65
Mureinik Avatar answered Sep 05 '25 06:09

Mureinik