Data Validation - Ignoring Blank Cells in Drop Down List

doublej41

Board Regular
Joined
Mar 9, 2011
Messages
86
I am an Excel novice and would appreciate some help.

I have an excel file with 2 worksheets. I am trying to create a drop down list in column C on the front worksheet 'Codes', that references a list of names on the other worksheet 'Names'.

I am including a number of blank cells at the bottom of the list so that new names can be added to the list easily. When I create the list in this way I get a whole load of blanks included in my drop down list.

Is there a way I can create the drop down list whilst ignoring any blank cells in the range?

I have tried the following but get the error message "You cannot use references to other worksheets or workbooks for Data Validation criteria"

=OFFSET(Names!$B$2;COUNTBLANK(OFFSET(Names!$B$2; 0;0;COUNTA(Names!$B:$B);1));0;COUNTA(Names!$B:$B )-1;1)

I have included an image to indicate what I am trying to do. Any suggestions would be greatly appreciated.

 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
I believe a Dynamic Range Name is what you need. It automatically expands/contracts to accommodate the data.

Data Validation cannot directly reference a range on another sheet.
However, DV can reference a Named Range...even if the destination is on another sheet.

See this site for instructions:
http://www.contextures.com/xlNames01.html#Dynamic

Pre-Excel 2007
• Insert.Name.Define
Excel 2007 and later
• Formula.Define_Name

Names in Workbook: LU_MyList
Refers to: =OFFSET(Names!$B$2;COUNTBLANK(OFFSET(Names!$B$2; 0;0;COUNTA(Names!$B:$B);1));0;COUNTA(Names!$B:$B )-1;1)

Then, when setting up your Data Validation...select the newly defined list name.

Does that help?
 
Upvote 0
That is spot on. Thank you very much for your help.

I was putting the formula into the DV source, whereas it needed to go under the Range Name.

Thanks again!
 
Upvote 0

Forum statistics

Threads
1,224,592
Messages
6,179,789
Members
452,942
Latest member
VijayNewtoExcel

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top