IF statement thats Adds

Solved/Closed
bob2011
Posts
8
Registration date
Thursday April 8, 2010
Status
Member
Last seen
April 26, 2010
- Apr 26, 2010 at 07:49 AM
bob2011
Posts
8
Registration date
Thursday April 8, 2010
Status
Member
Last seen
April 26, 2010
- Apr 26, 2010 at 09:28 AM
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 replies

rizvisa1
Posts
4479
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
May 5, 2022
770
Apr 26, 2010 at 08:14 AM
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)
1
bob2011
Posts
8
Registration date
Thursday April 8, 2010
Status
Member
Last seen
April 26, 2010

Apr 26, 2010 at 09:28 AM
i have solved what i was looking for.

the correct formula was:

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

thanks for your help anyway.
0