#1   Report Post  
Posted to microsoft.public.excel.misc
jc jc is offline
external usenet poster
 
Posts: 164
Default Excel Formula Help

I need a formula that returns a "1" in Cell B4 if A4 has text and a "0" if A4
is a blank cell.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Excel Formula Help

=IF(A4="",0,1)
--
Gary''s Student - gsnu200796
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default Excel Formula Help

This will return 1 if text or nothing if not blank and not text, or 0 for
blank

=IF(LEN(TRIM(A7))0,IF(ISTEXT(A7),1,""),0)

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"JC" wrote in message
...
I need a formula that returns a "1" in Cell B4 if A4 has text and a "0" if
A4
is a blank cell.


  #4   Report Post  
Posted to microsoft.public.excel.misc
jc jc is offline
external usenet poster
 
Posts: 164
Default Excel Formula Help

It worked! Thank you.

"Gary''s Student" wrote:

=IF(A4="",0,1)
--
Gary''s Student - gsnu200796

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,059
Default Excel Formula Help

On Jul 30, 8:56*am, JC wrote:
I need a formula that returns a "1" in Cell B4 if A4 has
text and a "0" if A4 is a blank cell.


Unfortunately, the phrases "has text" and "is blank" are ambigous.
Excel makes a distinction between text and numeric values. And Excel
makes a distinction between an empty cell (i.e. no formula or
constant) and a cell whose value is the null string; both appear
"blank", as well as a string of spaces.

If we take your request literally, then what do you want if neither
condition is true?

Perhaps the following will meet your needs (but I doubt it).

=if(istext(A4), 1, if(A4="", 0, ""))

Note that A4="" is true is A4 is empty, or A4 contains a value that is
the null string like the last else-expression of the second IF
function above.


  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,651
Default Excel Formula Help

=IF(ISTEXT(A4,1,IF(ISBLANK(A4),0,"A4 may have a number?"))

If, of course you don't want to distinguish between text and a number, the
formula could be changed, and similarly if you don't want to draw a
distinction between a blank cell and an empty text string.
Another possibility, depending on the answer to those questions, might be
=IF(A4="",0,1) or even =--(A4<"")

I have assumed that you want B4 to contain a number 0 or 1, rather than text
strings "0" or "1".
--
David Biddulph

"JC" wrote in message
...
I need a formula that returns a "1" in Cell B4 if A4 has text and a "0" if
A4
is a blank cell.



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
Excel 2002 Formula: Urgent Conditional Formula Required Right Away - if possible blue[_2_] Excel Discussion (Misc queries) 2 July 11th 07 06:08 PM
Build excel formula using field values as text in the formula val kilbane Excel Worksheet Functions 2 April 18th 07 01:52 PM
Excel 2002 formula displayed not value formula option not checked Dean Excel Worksheet Functions 1 February 28th 06 02:31 PM
How do I view formula results intead of formula in excel? davidinatlanta Excel Worksheet Functions 4 February 7th 06 03:02 PM
i edit a formula (excel) then it displays formula not answer caiman Excel Discussion (Misc queries) 2 September 9th 05 02:09 AM


All times are GMT +1. The time now is 11:02 AM.

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

About Us

"It's about Microsoft Excel"