If you are prepared to apply a series of named ranges (in the example, the occupied portions of B:G) then Data Validation with Allow: List and Source: =INDIRECT(INDEX($1:$1,MATCH(I2,A$1:A$7,0)))
might suit for entries in Column J:
Attempt at clarification:
It is generally easier to understand a formula from the inside outwards, so to start with =MATCH
: this looks to find the position in the A1:A7 list of the exact (ie ,0
) value entered in I2. For S.AMERICA
- good choice! :-) - that happens to be last (7th). This result is then fed to the =INDEX
part as the parameter to determine which column number is the relevant one (for the Validation by country). For Excel ColumnG is the seventh.
I have not been entirely conventional with the formula by not bothering with an array that has more than a single row/column – in part for the sake of convention that Validation and Lookup lists are more often arranged vertically than horizontally (eg VLOOKUP applied more often than HLOOKUP), in part because we are more used to seeing labels for columns than we are for rows, etc. – in effect for the same reason that spreadsheets are generally allowed to be longer than they are wide (eg 16,384 columns but 1,048,576 rows), in part for the sake of the image aspect ratio in my answer.
Alternative layouts, though possibly slightly less convenient in practice (eg for setting up the named ranges) might nevertheless help with my attempt at explanation:
Left Image below: Transpose the country data to a more conventional layout for a vlookup (and might as well then delete row with Continents
) and the validation formula would be:
=INDIRECT(INDEX(A$1:A$6,MATCH(A8,A$1:A$6,0)))
(for which I had to move the ‘trigger cell’ I2 etc as that cell is now required for other data – I chose A8 etc instead).
Right Image below: Leaving ‘trigger cell’ as for Left image and also doing away with Continents
, the validation formula would be:
=INDIRECT(INDEX(C$1:H$1,MATCH(A8,C$1:H$1,0)))