LibreOffice Calc dependent dropdowns

Is there a way of creating a dropdown that is dependant on another cell, and looks up the values in the row rather than the column?

I have a lookup sheet that has a list of terms in column A, and a series of sub-terms for each entry in cells in that row. I can create a drop down in the main sheet that allows me to select the main term, now I want a second dropdown that gives me a list of the sub-terms for the selected main term.

The only examples I can find seem to look vertically rather than horizontally.

Please upload an ODF type sample file here. And try the VLOOKUP(), HLOOKUP() functions for dinamic change of the list of the subterms)

lookup_test.ods (15.8 KB)

This is the test file as I have it at the moment. The coding is based on an example I found.
I’ve looked at Hlookup, but that only seems to return a single value whereas I want to populate a dropdown.

Thanks for the help…

Hallo
See attached file
index_match_validity.ods (17.3 KB)

Hi,

many thanks for this, that does exactly what I wanted.
For information, what was it that you did differently to make it work?

cheers

see the criteria-definition of →Data→Validity