Solved

# Excel 2003 avoiding blanks in a drop down list

Posted on 2014-02-04
Medium Priority
1,419 Views
I have read over some solutions for this issues in Excel but can't follow their solutions to implement.

I have a range of \$E\$2:\$E\$12 that is the input range for a drop down list.  The cell link is \$G\$2.... how can I change this control to not display blanks from the range of E2:E12?
0
Question by:thandel
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points
• 5
• 4

LVL 19

Expert Comment

ID: 39833748
if you won´t add or remove items from the list, just sort your drop down items A->Z or vice versa and make a range to fit all items exactly
0

LVL 23

Expert Comment

ID: 39833750
You would need to rearrange the range so that the blanks are at the bottom.

IF you can try sorting the list in E2:E12 so that blanks are at the bottom.

Then you can use this as your Source formula in the Data Validation for G2.

=OFFSET(\$E\$2,,,COUNTA(\$E\$2:\$E\$12,1))

If you can't sort, then start a new list say in F2 with formula:

=IFERROR(INDEX(\$E\$2:\$E\$12,SMALL(IF(\$E\$2:\$E\$12<>"",ROW(\$E\$2:\$E\$12)-ROW(\$E\$2)+1),ROWS(\$F\$2:\$F2))),"")

confirmed with CTRL+SHIFT+ENTER not just ENTER and copied down to F12.

Now your Source formula for Data Validation in G2 would be:

=OFFSET(\$F\$2,,,COUNTIF(\$F\$2:\$F\$12,"?*"),1)
0

Author Comment

ID: 39833763
Thanks List is sorted and blanks are at bottom but number of blanks varry.  I'm not following:
"Then you can use this as your Source formula in the Data Validation for G2"

Is this part of the drop down properties?
0

LVL 23

Accepted Solution

NBVC earned 2000 total points
ID: 39833785
Instead of referencing the range E2:E12 for your data validation replace that with the formula as a reference:

=OFFSET(\$E\$2,,,COUNTA(\$E\$2:\$E\$12,1))

so go to G2, then Data Validation, replace what you have in the Source field with the above formula.

If \$E\$2:\$E\$12 is a named range, called List, replace that in the formula:

=OFFSET(\$E\$2,,,COUNTA(List,1))
0

Author Comment

ID: 39833888
I don't have any data validation... its a preselect list so no validation is needed... however when I look in the data validation I don't see any options as you have listed for this.  There is no "source field" for G2.  I've attached a screen shot for assistance.
Screen.jpg
0

LVL 23

Expert Comment

ID: 39833892
So how are you making selections from that list then?

In that window, you have to select List from the Allow menu first, then a Source field will show at the bottom, where you enter the formula.
0

Author Comment

ID: 39833949
I'm not following which window you are referring to... the window in the screen capture I sent?  I'm not seeing anything like that.
0

LVL 23

Expert Comment

ID: 39833961
Yes, in the screen shot you sent, do you see where it says Allow and then in the white field it says "Any Value"?  Click the drop down and you can select "List".

After you make that selection, another white field will show below entitled "Source".  That is where you enter the validation formula.

If you can attach your workbook, I can show you....
0

Author Comment

ID: 39834039
Ah I see so basically I'm ditching my original drop down and using G2 which now turned into a drop down... am I following correctly?
0

LVL 23

Expert Comment

ID: 39834218
Yes, but it doesn't necessarily mean you have to use G2.  You can apply in any available cell.
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
###### Suggested Courses
Course of the Month13 days, 15 hours left to enroll