Forum Discussion
cdiaa
Mar 06, 2020Copper Contributor
How do I find the sum of cells that are either one number or the other?
I have a spreadsheet with 2500 rows of 10 randomly generated numbers (either 1, -1, 10, -10, 100 or -100). For every row, I want 3 functions. The first would calculate the absolute value of the sum o...
- Mar 06, 2020
You can change the formulas as follows:
=SUMPRODUCT(IF(ABS(A1:J1)=1,A1:J1))
=SUMPRODUCT(IF(ABS(A1:J1)=10,A1:J1))/10
=SUMPRODUCT(IF(ABS(A1:J1)=100,A1:J1))/100
cdiaa
Mar 06, 2020Copper Contributor
Haytham Amairah Twifoo Thank you, but this wasn't what I was looking for.
I meant that I want something like this:
-1 1 -1 1 1 would return the answer of 1 because -1 + 1 + (-1) + 1 + 1 = 1.
Haytham Amairah
Mar 06, 2020Silver Contributor
You can change the formulas as follows:
=SUMPRODUCT(IF(ABS(A1:J1)=1,A1:J1))
=SUMPRODUCT(IF(ABS(A1:J1)=10,A1:J1))/10
=SUMPRODUCT(IF(ABS(A1:J1)=100,A1:J1))/100
- cdiaaMar 06, 2020Copper Contributor
Thank you Haytham Amairah !