COUNT BLANK AND ZERO AS THE SAME THING

J

jjlang

I'm writing an IF function and want my formula to return a 1 if the cell has
a number in it, but return a 0 if the cell is blank of has a zero in it.

ie Cell A1 would return 1 if A2 has 3 in it, but return 0 if A2 is blank or
has 0 in it.


Thnanks
 
R

Rick Rothstein

You can use this IF formula...

=IF(AND(ISNUMBER(A1),A1<>0),1,0)

or you can use this shorter non-IF formula instead...

=--AND(ISNUMBER(A1),A1<>0)
 
R

Ron Rosenfeld

I'm writing an IF function and want my formula to return a 1 if the cell has
a number in it, but return a 0 if the cell is blank of has a zero in it.

ie Cell A1 would return 1 if A2 has 3 in it, but return 0 if A2 is blank or
has 0 in it.


Thnanks

=if(a2=0,0,1)

or

=--(A2<>0)

or

=(A2<>0)*1
--ron
 
J

JP Ronse

Hi jj

Try something as

=COUNT(C26:C28)-COUNTIF(C26:C28,0)

With kind regards,

JP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top