Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel IF Question 1

Status
Not open for further replies.

cdove

MIS
Mar 20, 2002
153
GB
Is it possible to use an IF statement to have a value of 1 if a cell has text in and 0 if no text exists?

eg IF (Cell contains text) = "1", "0
 
Absolutely! =if(a1>0,a1+b1,"")

There's always a better way. The fun is trying to find it!
 
Hi,
[tt]
=IF(ISBLANK(A1),1,0)
[/tt]
and...

why do you want the CHARACTERS "0" & "1" rather than the NUMBERS 0 & 1???

:)

Skip,

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
oops
[tt]
=IF(ISBLANK(A1),0,1)
[/tt]


Skip,

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Interestingly, this also works.

=1-ISBLANK(B1)

Perhaps not as readable, but I find I can use the Boolean True / False (treated as 1/0) in all sorts of places.
 
And if you really want to cut it down, and assuming the choice is text or Not text as stated, then

=--ISTEXT(B1)

will also do the job, though not as generic as the others, which also cater for numerics, which this won't.

Regards
Ken.................

----------------------------------------------------------------------------
[peace]It's easier to beg forgiveness than ask permission[2thumbsup]

----------------------------------------------------------------------------
 
Thanks Everyone. I eventually went for SkipVought..
 
LOL :)

----------------------------------------------------------------------------
[peace]It's easier to beg forgiveness than ask permission[2thumbsup]

----------------------------------------------------------------------------
 
Geez,

I was out cutting the lawn and felt these STRANGE VIBES!!!

Little did I know I'd become the HOTTIE of Tek-Tips at the late age of 62!

What will my WIFE say???

;-)

Skip,

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top