Is it possible, without VBA, to test the “emptiness” of a cell? For example,
a formula that will return 1 if a cell is unused (has nothing in it), 2 if
the cell has a formula returning a null string:
=IF(1=1,””,””)
3 if the cell has a single quote in it and 4 otherwise?

Signature
Gary''s Student - gsnu2007xx
Ron Rosenfeld - 07 Feb 2008 15:05 GMT
>Is it possible, without VBA, to test the emptiness of a cell? For example,
>a formula that will return 1 if a cell is unused (has nothing in it), 2 if
[quoted text clipped - 3 lines]
>
>3 if the cell has a single quote in it and 4 otherwise?
=IF(ISBLANK(A1),1,IF(LEN(A1)=0,2,IF(NOT(ISERR(FIND("'",A1))),3,4)))
Of course, this is testing for the presence of a single quote -- NOT for the
use of a single quote to tell Excel to format the rest of the entry as TEXT.
--ron
Ron Rosenfeld - 07 Feb 2008 15:12 GMT
>Is it possible, without VBA, to test the emptiness of a cell? For example,
>a formula that will return 1 if a cell is unused (has nothing in it), 2 if
[quoted text clipped - 3 lines]
>
>3 if the cell has a single quote in it and 4 otherwise?
Something like:
=IF(ISBLANK(A1),1,IF(AND(LEN(A1)=0,CELL("prefix",A1)="'"),3,IF(LEN(A1)=0,2,4)))
detects if the single quote is present by itself and as a prefix character.
But you really didn't specify that.
--ron
Gary''s Student - 07 Feb 2008 15:24 GMT
Excellent!!!
This is exactly what I need!

Signature
Gary''s Student - gsnu200767
> >Is it possible, without VBA, to test the “emptiness” of a cell? For example,
> >a formula that will return 1 if a cell is unused (has nothing in it), 2 if
[quoted text clipped - 12 lines]
> But you really didn't specify that.
> --ron
Ron Rosenfeld - 07 Feb 2008 15:39 GMT
>Excellent!!!
>
>This is exactly what I need!
Glad to help. Thanks for the feedback.
--ron
Don Guillett - 07 Feb 2008 15:43 GMT
try this logic to get to the last one
=trim(a1)
=len(trim(a1))
=if(len(trim(a1))<1,1,2)

Signature
Don Guillett
Microsoft MVP Excel
SalesAid Software
dguillett1@austin.rr.com
> Is it possible, without VBA, to test the “emptiness” of a cell? For
> example,
[quoted text clipped - 4 lines]
>
> 3 if the cell has a single quote in it and 4 otherwise?
Gary''s Student - 07 Feb 2008 20:44 GMT
thanks

Signature
Gary''s Student - gsnu200768
> try this logic to get to the last one
> =trim(a1)
[quoted text clipped - 9 lines]
> >
> > 3 if the cell has a single quote in it and 4 otherwise?