SOLVED

Append Additional Option Data Validation With Dynamic Arrays

Copper Contributor

I'll try to summarize this as best i can.

 

We are using the spill range below to populate a Data Validation List.

 

ArgentinaBiomac
ArgentinaEarly Crop
ArgentinaKingberry S.A
ArgentinaLA LOMA DEL ACONQUIJA
ArgentinaS.A Veracruz
BelgiumGreenyard Frozen
BelgiumPasfrost NV
BrazilAcai Macunaima
BrazilTropical Acai
CanadaSeenergy Foods
CanadaSouth Alder Farm

 

 

I'm using the following as the Data Validation List Function:  OFFSET('Supplier Ref'!$A$1#,MATCH(G2,INDEX('Supplier Ref'!$A$1#,,1),0)-1,1,COUNTIF(INDEX('Supplier Ref'!$A$1#,,1),G2),1),,1))

 

It's meant to filter supplier Data Validation List options based on the selection made in column G. Wat we are trying to achieve is to add the generic "No Supplier" option to the list independently of the contents of Column G.

 

So if Argentina entered in Column G the drop down in Column H should be:

Biomac
Early Crop
Kingberry S.A
LA LOMA DEL ACONQUIJA
S.A Veracruz
No Supplier

 

2 Replies
best response confirmed by VI_Migration (Silver Contributor)
Solution

Hi @eddgueLMX 

 

One way (D2:E12 simulates your current dynamic array):

 

CombinedArrays.png

 

1) Create another dynamic array (in G2# above) that lists the unique countries in one column and "No Supplier" next to each entry. Formula in G2:

=CHOOSE({1;2}, UNIQUE(INDEX(D2#,,1)), "No Supplier")

2) Combine your current dynamic array with the one created above. Formula in J2:

=LET(
    dummyArr, D2#,
    noSupArr, G2#,
    dummyRows, ROWS(dummyArr),
    seqRows, SEQUENCE(dummyRows + ROWS(noSupArr)),
    SORT(IF(seqRows <= dummyRows, dummyArr, INDEX(noSupArr,seqRows-dummyRows,{1;2})),1)
)

3) Revise your Data Validation formula so it refers to J2#

 

Sample attached

 

@L z.Thank you! This worked perfectly! 

1 best response

Accepted Solutions
best response confirmed by VI_Migration (Silver Contributor)
Solution

Hi @eddgueLMX 

 

One way (D2:E12 simulates your current dynamic array):

 

CombinedArrays.png

 

1) Create another dynamic array (in G2# above) that lists the unique countries in one column and "No Supplier" next to each entry. Formula in G2:

=CHOOSE({1;2}, UNIQUE(INDEX(D2#,,1)), "No Supplier")

2) Combine your current dynamic array with the one created above. Formula in J2:

=LET(
    dummyArr, D2#,
    noSupArr, G2#,
    dummyRows, ROWS(dummyArr),
    seqRows, SEQUENCE(dummyRows + ROWS(noSupArr)),
    SORT(IF(seqRows <= dummyRows, dummyArr, INDEX(noSupArr,seqRows-dummyRows,{1;2})),1)
)

3) Revise your Data Validation formula so it refers to J2#

 

Sample attached

 

View solution in original post