Creating a NonBlank list for Data Validation

JohnnyTightlips

Board Regular
Joined
Aug 13, 2006
Messages
94
Here’s an interesting one for the forum.

Firstly, I'd rather not use VBA. Secondly, i have experiemented with Data Validation and have not found an appropriate way to achieve what I want to. If there is a simpler way to achieve it, please let me know. i fear I have overengineered this solution!!


I use a range as the validation list for some dropdown boxes. The range contains formulas with the outcome of “” if false. Therefore, when the dropdown list is selected, there appears many “blank” options scattered through the list; which are the “”s.

I am trying to create a helper column adjacent to the range that will list all non “” values concurrently, and then create a dynamic named range for use as the validation list.

The formula I am using is as follows

=index(A10:$A$25,match(1,(A10:$A$25<>,($B$9:B9)*( A10:$A$25<>””),0))

Entered as an array formula. Note the use of relative and absolute referencing: the range decreases as the formula is dragged down.

What I am trying to get the formula to do is: return the first value from the range that does not equal any previous values (the $B$9:B9 reference, which increases as the formula is dragged down) and does not equal “”.

The formula works until it finds a value after a “” reference (cell B15 -highlighted) It duplicates Fifth-Match even though the cell above it is Fifth match. i.e it appears the first match criteria hasn't worked. Can anyone help me list all non "" concurrently.

Let me know if you require clarification, i appreciate it's hard to write down a lot of contextual background in a post
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.


A10, copied down:

=IF(E10&F10="","",IF(COUNTBLANK(E10:F10)=1,E10&F10,E10&"-"&F10))

B9 must house a 0.

B10, copied down:

=IF(A10="","",LOOKUP(9.99999999999999E+307,$B$9:B9)+1)

C9:

=LOOKUP(9.99999999999999E+307,B9:B18)

C10, copied down:

=IF(ROWS($C$10:C10)<=$C$9,LOOKUP(ROWS($C$10:C10),$B$10:$B$18,$A$10:$A$18),"")

The list in column C is defined by:

=OFFSET(Sheet1!$C$10,0,0,MATCH("*",Sheet1!$C:$C,-1)-MIN(ROW(Sheet1!$C$10)))

The link quoted by Brian creates an alphabetical list, which might be more appropriate to take up.
 
Upvote 0

Forum statistics

Threads
1,214,786
Messages
6,121,553
Members
449,038
Latest member
Guest1337

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