Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 577
Default Ignoring Blanks in Data Validation

How do you ignore blank cells in data validation ranges? I know there's a
check box that says "Ignore Blanks" but that doesn't seem to work for me. If
I have a list of potentially 5 cells that could contain values, but only 3 of
them do, is there a way to ignore the 2 blank cells, but when there is a
value there, for it to register?

Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Ignoring Blanks in Data Validation

If you're using the range of cells as the source for a drop down list then
the source has to be a contiguous range (no empty cells between entries).

--
Biff
Microsoft Excel MVP


"Scott" wrote in message
...
How do you ignore blank cells in data validation ranges? I know there's a
check box that says "Ignore Blanks" but that doesn't seem to work for me.
If
I have a list of potentially 5 cells that could contain values, but only 3
of
them do, is there a way to ignore the 2 blank cells, but when there is a
value there, for it to register?

Thanks.



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7,247
Default Ignoring Blanks in Data Validation

There isn't really an easy way to do this. And the "Ignore Blanks"
option in Validation indicates whether blanks are allowed to be
entered into the validated cell, not to ignore blanks in the
validation list. (And even this broken. If you clear the Ignore Blanks
setting in Validation, you cannot delete with the Back Space key a
validated cell, but you can with the Delete key. It is broken.)

If you want to remove blank elements from the validation list, try
this. Assign the name "BlanksRange" to the range of cells that contain
the valid values along with the blank cells. Then, create another
defined name of "NoBlanksRange" referring to a range of cells that
should contain the non-blank values from BlanksRange. Enter the
following array formula in the first cell of NoBlanksRange and fill
down through the entire NoBlanksRange.

=IF(ROW()-ROW(NoBlanksRange)+1ROWS(BlanksRange)-
COUNTBLANK(BlanksRange),"",INDIRECT(ADDRESS(SMALL(
(IF(BlanksRange<"",ROW(BlanksRange),ROW()+ROWS(Bl anksRange))),
ROW()-ROW(NoBlanksRange)+1),COLUMN(BlanksRange),4)))

This is an Array Formula, so you MUST press CTRL SHIFT ENTER rather
than just ENTER when you first enter the formula and whenever you edit
it later. If you do this correctly, Excel will display the formula in
the formula bar enclosed in curly braces { }. The formula will not
work properly if you do not use CTRL SHIFT ENTER. See
http://www.cpearson.com/Excel/ArrayFormulas.aspx for much more
information about array formulas in general.

This formula will place all of the values in BlanksRange at the top of
NoBlanksRange, and the rest of NoBlanksRange will be empty.

Next, you need to create a formula that will create the address of the
top part of NoBlanksRange, referring only to those cells in
NoBlanksRange that have values. Use the following formula to do this:

=ADDRESS(ROW(NoBlanksRange),COLUMN(NoBlanksRange))
&":"&ADDRESS(MAX(ROW(NoBlanksRange)*(NoBlanksRange <"")),COLUMN())

This, too, is an Array Formula, so be sure to press CTRL SHIFT ENTER
rather than just ENTER. Name the cell that contains this formula
"ValAddr".

Now, select the cell to which you want to add validation, open the
Data Validation dialog, choose List in the Allow list, and enter

=INDIRECT(ValAddr)

in the Source box. The INDIRECT function tells Validation to look in
the cell named ValAddr, get the value of that cell (which is a range
address), and then use that range.

So, in the end, you should have something like....


Name=BlanksRange
first
second
<blank cell
third
<blank cell
last

Name=NoBlanksRange
first
second
third
last
<blank cells follow

Name = ValAddr
$H$11:$H$20 ' or whatever come from NoBlanksRange.


Cell To Validation
Validation = =INDIRECT(ValAddr)


Sounds like a lot of work? Yeah, it is, but I'm not aware of any other
way.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)



On Wed, 27 May 2009 13:08:03 -0700, Scott
wrote:

How do you ignore blank cells in data validation ranges? I know there's a
check box that says "Ignore Blanks" but that doesn't seem to work for me. If
I have a list of potentially 5 cells that could contain values, but only 3 of
them do, is there a way to ignore the 2 blank cells, but when there is a
value there, for it to register?

Thanks.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Ignoring Blanks in Data Validation

You misunderstand the purpose of "ignore blanks"

Blank Cells in Source List

If the source list is a named range that contains blank cells, users may be
able to type any entry, without receiving an error message.

I think what you really want is a dynamic named range that will show only
non-blank cells in the range and expand as you add more items.

See Debra Dalgleish's site for creating dynamic ranges.

http://www.contextures.on.ca/xlNames01.html#Dynamic


Gord Dibben MS Excel MVP


On Wed, 27 May 2009 13:08:03 -0700, Scott
wrote:

How do you ignore blank cells in data validation ranges? I know there's a
check box that says "Ignore Blanks" but that doesn't seem to work for me. If
I have a list of potentially 5 cells that could contain values, but only 3 of
them do, is there a way to ignore the 2 blank cells, but when there is a
value there, for it to register?

Thanks.


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
Ignoring blanks from Column(s) Michael Excel Worksheet Functions 3 December 3rd 06 08:58 PM
Ignoring blanks and consolidating stevemyers Excel Discussion (Misc queries) 1 June 28th 06 07:39 PM
Ignoring blanks exsam21 Excel Discussion (Misc queries) 2 January 18th 06 05:19 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 11:45 AM.

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"