# Truncating List to avoid blanks, errors etc.

1. ## Truncating List to avoid blanks, errors etc.

I have a formula which generates a list of unique values from a table in another worksheet.
These entries are used as a validated list for drop-downs in other parts of the workbook.
Because I don't know how many entries my list will have I have to define the list with a larger range than is likely to be needed(or I'll miss some entries).
This means I'll get zeros or NA errors when the formula runs out of unique values - and these then show in the drop-downs.
Which is annoying if not catastrophic.
{=INDEX(DataPull!\$I7:\$I\$1000, MATCH(0, COUNTIF(C\$1:\$C8, DataPull!\$I7:\$I1006), 0))}......this gives me my values, typically 10-20 entries.
Would love to know how to restrict my validated list to just these entries.

2. ## Re: Truncating List to avoid blanks, errors etc.

Are you sure that should be an array formula?

I have this which works and is not an array:
With values in column B starting at B1...
in A1
=B1

in A2
=IFERROR(IF(INDEX(\$B\$2:\$B\$20,MATCH(0,INDEX(COUNTIF(\$A\$1:A4,\$B\$2:\$B\$20),0,0),0))<>0,INDEX(\$B\$2:\$B\$20,MATCH(0,INDEX(COUNTIF(\$A\$1:A4,\$B\$2:\$B\$20),0,0),0)),""),"")
copy the formula in A2 ddown the column

3. ## Re: Truncating List to avoid blanks, errors etc.

This works for me if I change A4 to A2 - or the equivalent for the range in my worksheet - but use it as an array in B1(or equivalent, again).
Thanks for pointing me in the right direction.

There are currently 1 users browsing this thread. (0 members and 1 guests)