Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default COUNT BLANK AND ZERO AS THE SAME THING

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
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default COUNT BLANK AND ZERO AS THE SAME THING

=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

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default COUNT BLANK AND ZERO AS THE SAME THING

=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

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default COUNT BLANK AND ZERO AS THE SAME THING

One way...

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

--
Biff
Microsoft Excel MVP


"jjlang" wrote in message
...
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



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,934
Default COUNT BLANK AND ZERO AS THE SAME THING

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" wrote in message
...
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




  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,651
Default COUNT BLANK AND ZERO AS THE SAME THING

On Fri, 9 Apr 2010 06:57:01 -0700, 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


=if(a2=0,0,1)

or

=--(A2<0)

or

=(A2<0)*1
--ron
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 174
Default COUNT BLANK AND ZERO AS THE SAME THING

Hi jj

Try something as

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

With kind regards,

JP

"jjlang" wrote in message
...
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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to count#cells w/= value in other column and not count blank c aganoe Excel Worksheet Functions 4 April 9th 10 11:36 AM
count until blank cell beto Excel Discussion (Misc queries) 2 March 16th 10 08:56 PM
Count from Blank & Non-Blank Cells Mandeep Dhami Excel Discussion (Misc queries) 4 February 12th 08 03:25 PM
count blank John in Wembley Excel Discussion (Misc queries) 3 September 7th 07 07:38 PM
Count if not blank... Paul (ESI) Excel Discussion (Misc queries) 4 October 14th 05 01:48 PM


All times are GMT +1. The time now is 07:25 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"