IF statement thats Adds

Solved/Closed
bob2011 Posts 8 Registration date Thursday 8 April 2010 Status Member Last seen 26 April 2010 - 26 Apr 2010 à 07:49
bob2011 Posts 8 Registration date Thursday 8 April 2010 Status Member Last seen 26 April 2010 - 26 Apr 2010 à 09:28
Dear All,

I would like to create an If statement which returns a 1 if a cell is greater than 0, then look at the next cell and do the same. Then add all the 1's together and return a number which adds all the 1's together after looking at all the cells.

Can anybody provide a formula which will do this ? Thanks

2 responses

rizvisa1 Posts 4478 Registration date Thursday 28 January 2010 Status Contributor Last seen 5 May 2022 766
26 Apr 2010 à 08:14
There is a lot of ambiguity in your question. Since you have not mention where this "next cell" is, I am presuming it is on same column but next row.

Let say

A2 and A3 are two cells that are to be looked for

=IF(A2>0, 1) + IF(A3>0,1,0)
bob2011 Posts 8 Registration date Thursday 8 April 2010 Status Member Last seen 26 April 2010
26 Apr 2010 à 09:28
i have solved what i was looking for.

the correct formula was:

=COUNTIF(C31:C58,">0")

thanks for your help anyway.