Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default MS Excel Data Validation, Ignore Blanks in List

Hello,

I have a problem utilizing the Data Validation tool in Excel. If I
have a list in one column with the following, for example:

-----------------
Dog
Cat
Rabbit

Frog
Kangaroo
-----------------

See how the list is really six items long? However, if I use a data
validation on a separate cell with a List referring to the above range
of animals, the validation list shows the exact same list:

-----------------
Dog
Cat
Rabbit

Frog
Kangaroo
-----------------

However, how could I fix this without using "Sort" so that the data
validation list in the cell shows the following:

-----------------
Dog
Cat
Rabbit
Frog
Kangaroo
-----------------

Where the rows are only populated by nonblank values. This is
especially handy when my real range is say hundreds of rows long with
many blank cells inbetween the beginning and the end of the range.
I've seen a lot of other forums where people have suggested using the
Offset function; however, that only works to dynamically cut off the
range when there are blanks following the nonblank cells. It does NOT
work for ranges with intermittent blanks.

Thanks,
D
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default MS Excel Data Validation, Ignore Blanks in List

One way to get there ..

Assume the source for the DV is in Sheet1's A1:A1000
In C1: =IF(A1="","",ROW())
In D1: =INDEX(A:A,SMALL(C:C,ROW()))
Select C1:D1, copy down to D1000

Then you could use this expression as the dynamic range for your DV:
=OFFSET(Sheet1!$D$1,,,SUMPRODUCT(--NOT(ISERROR(Sheet1!$D$1:$D$1000))))
where the height param is given by the sumproduct expression on
the derived col D as the proxy source. The DV droplist will then
return the exact results that you seek, ie expand or contract accordingly.
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"D Lu" wrote in message
...
Hello,

I have a problem utilizing the Data Validation tool in Excel. If I
have a list in one column with the following, for example:

-----------------
Dog
Cat
Rabbit

Frog
Kangaroo
-----------------

See how the list is really six items long? However, if I use a data
validation on a separate cell with a List referring to the above range
of animals, the validation list shows the exact same list:

-----------------
Dog
Cat
Rabbit

Frog
Kangaroo
-----------------

However, how could I fix this without using "Sort" so that the data
validation list in the cell shows the following:

-----------------
Dog
Cat
Rabbit
Frog
Kangaroo
-----------------

Where the rows are only populated by nonblank values. This is
especially handy when my real range is say hundreds of rows long with
many blank cells inbetween the beginning and the end of the range.
I've seen a lot of other forums where people have suggested using the
Offset function; however, that only works to dynamically cut off the
range when there are blanks following the nonblank cells. It does NOT
work for ranges with intermittent blanks.

Thanks,
D



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default MS Excel Data Validation, Ignore Blanks in List

Max,

I like your idea with the C1 and D1 and it works well. However, if I
have a list of say, six elements like above but one element is blank,
the DV list now shows the five non-blank elements and then a #NUM!
error. If I have seven elements two of which are non-blank and non-
consecutive, then the DV list displays the five non-blank and then two
#NUM! errors. Anyway to remove those #NUM! errors?

Thanks,
D

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default MS Excel Data Validation, Ignore Blanks in List

On Mar 20, 1:38 am, "Max" wrote:
One way to get there ..

Assume the source for the DV is in Sheet1's A1:A1000
In C1: =IF(A1="","",ROW())
In D1: =INDEX(A:A,SMALL(C:C,ROW()))
Select C1:D1, copy down to D1000

Then you could use this expression as the dynamic range for your DV:
=OFFSET(Sheet1!$D$1,,,SUMPRODUCT(--NOT(ISERROR(Sheet1!$D$1:$D$1000))))
where the height param is given by the sumproduct expression on
the derived col D as the proxy source. The DV droplist will then
return the exact results that you seek, ie expand or contract accordingly.
--
Max
Singaporehttp://savefile.com/projects/236895
xdemechanik
---"D Lu" wrote in message

...

Hello,


I have a problem utilizing theDataValidationtool inExcel. If I
have alistin one column with the following, for example:


-----------------
Dog
Cat
Rabbit


Frog
Kangaroo
-----------------


See how thelistis really six items long? However, if I use adata
validationon a separate cell with aListreferring to the above range
of animals, thevalidationlistshows the exact samelist:


-----------------
Dog
Cat
Rabbit


Frog
Kangaroo
-----------------


However, how could I fix this without using "Sort" so that thedata
validationlistin the cell shows the following:


-----------------
Dog
Cat
Rabbit
Frog
Kangaroo
-----------------


Where the rows are only populated by nonblank values. This is
especially handy when my real range is say hundreds of rows long with
many blank cells inbetween the beginning and the end of the range.
I've seen a lot of other forums where people have suggested using the
Offset function; however, that only works to dynamically cut off the
range when there areblanksfollowing the nonblank cells. It does NOT
work for ranges with intermittentblanks.


Thanks,
D


I just wrote to you... I found and solved the problem. Thanks a
million!!

Regards,
D
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default MS Excel Data Validation, Ignore Blanks in List

Welcome, glad to hear that.
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"D Lu" wrote
I just wrote to you... I found and solved the problem. Thanks a
million!!


Max,

I like your idea with the C1 and D1 and it works well. However, if I
have a list of say, six elements like above but one element is blank,
the DV list now shows the five non-blank elements and then a #NUM!
error. If I have seven elements two of which are non-blank and non-
consecutive, then the DV list displays the five non-blank and then two
#NUM! errors. Anyway to remove those #NUM! errors?

Thanks,
D



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
Blanks Data Validation List FARAZ QURESHI Excel Discussion (Misc queries) 4 March 13th 08 12:40 PM
DATA Validation (Ignore Blanks) el zorro[_2_] Excel Discussion (Misc queries) 3 May 15th 07 12:27 AM
Why is * valid if Excel data validation list has no blanks or *? Loligo Excel Worksheet Functions 1 February 28th 07 06:45 PM
Data Validation - ignore blanks Neville Excel Discussion (Misc queries) 10 November 9th 05 02:03 PM
Ignore Blanks in Data Validation Ricky Excel Worksheet Functions 9 July 7th 05 08:24 PM


All times are GMT +1. The time now is 04:41 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"