Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default Well, how empty is it?

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?

--
Gary''s Student - gsnu2007xx
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,651
Default Well, how empty is it?

On Thu, 7 Feb 2008 06:51:04 -0800, Gary''s Student
wrote:

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?



=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
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,651
Default Well, how empty is it?

On Thu, 7 Feb 2008 06:51:04 -0800, Gary''s Student
wrote:

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?


Something like:

=IF(ISBLANK(A1),1,IF(AND(LEN(A1)=0,CELL("prefix",A 1)="'"),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
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default Well, how empty is it?

Excellent!!!

This is exactly what I need!
--
Gary''s Student - gsnu200767


"Ron Rosenfeld" wrote:

On Thu, 7 Feb 2008 06:51:04 -0800, Gary''s Student
wrote:

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?


Something like:

=IF(ISBLANK(A1),1,IF(AND(LEN(A1)=0,CELL("prefix",A 1)="'"),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

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,651
Default Well, how empty is it?

On Thu, 7 Feb 2008 07:24:00 -0800, Gary''s Student
wrote:

Excellent!!!

This is exactly what I need!
--
Gary''s Student - gsnu200767


Glad to help. Thanks for the feedback.
--ron


  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,124
Default Well, how empty is it?

try this logic to get to the last one
=trim(a1)
=len(trim(a1))
=if(len(trim(a1))<1,1,2)

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Gary''s Student" wrote in message
...
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?

--
Gary''s Student - gsnu2007xx


  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default Well, how empty is it?

thanks
--
Gary''s Student - gsnu200768


"Don Guillett" wrote:

try this logic to get to the last one
=trim(a1)
=len(trim(a1))
=if(len(trim(a1))<1,1,2)

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Gary''s Student" wrote in message
...
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?

--
Gary''s Student - gsnu2007xx



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
Clipboard empty but get cannot empty CB when trying to copy Peter @ ServiceMaster Excel Worksheet Functions 0 February 22nd 07 03:58 PM
why a reference to an empty cell is not considered empty Nicoscot Excel Discussion (Misc queries) 10 March 10th 06 05:36 AM
in excel..:can't empty clip are" but already empty Alan Gauthier Excel Discussion (Misc queries) 0 February 10th 06 08:02 PM
Excel - Autom. Filter "Empty / Non Empty cells" should come first Rom Excel Discussion (Misc queries) 0 August 10th 05 04:32 PM
How can I convert empty strings to empty cells? Shane Excel Discussion (Misc queries) 2 July 19th 05 12:10 PM


All times are GMT +1. The time now is 09:29 PM.

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"