PC Review


Reply
Thread Tools Rate Thread

COUNT BLANK AND ZERO AS THE SAME THING

 
 
jjlang
Guest
Posts: n/a
 
      9th Apr 2010
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
 
Reply With Quote
 
 
 
 
Teethless mama
Guest
Posts: n/a
 
      9th Apr 2010
=COUNT(A:A)-COUNTIF(A:A,0)


"jjlang" wrote:

> 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

 
Reply With Quote
 
adam6b
Guest
Posts: n/a
 
      9th Apr 2010
=if(or(A2=0,A2=""),0,1)

"jjlang" wrote:

> 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

 
Reply With Quote
 
T. Valko
Guest
Posts: n/a
 
      9th Apr 2010
One way...

=--AND(COUNT(A1),A1<>0)

--
Biff
Microsoft Excel MVP


"jjlang" <(E-Mail Removed)> wrote in message
news:96E80B98-9DA2-4083-A730-(E-Mail Removed)...
> 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



 
Reply With Quote
 
Rick Rothstein
Guest
Posts: n/a
 
      9th Apr 2010
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)

--
Rick (MVP - Excel)



"jjlang" <(E-Mail Removed)> wrote in message
news:96E80B98-9DA2-4083-A730-(E-Mail Removed)...
> 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


 
Reply With Quote
 
Ron Rosenfeld
Guest
Posts: n/a
 
      9th Apr 2010
On Fri, 9 Apr 2010 06:57:01 -0700, jjlang <(E-Mail Removed)>
wrote:

>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
 
Reply With Quote
 
JP Ronse
Guest
Posts: n/a
 
      9th Apr 2010
Hi jj

Try something as

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

With kind regards,

JP

"jjlang" <(E-Mail Removed)> wrote in message
news:96E80B98-9DA2-4083-A730-(E-Mail Removed)...
> 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



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to count#cells w/= value in other column and not count blank c aganoe Microsoft Excel Worksheet Functions 4 9th Apr 2010 11:36 AM
Count from Blank & Non-Blank Cells Mandeep Dhami Microsoft Excel Misc 2 12th Feb 2008 03:25 PM
RE: Count from Blank & Non-Blank Cells Stefi Microsoft Excel Misc 1 12th Feb 2008 08:27 AM
Change Line Count to not count blank lines =?Utf-8?B?Q2Fyb2w=?= Microsoft Word Document Management 4 27th Nov 2004 01:46 PM
Count blank cells until a non-blank cell is reached tim Microsoft Excel Worksheet Functions 9 7th Jul 2004 06:46 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:10 AM.