I have a table that contains a "key" column. The values in this column contain either ID numbers or various "keys" that refer to groups of ID numbers. I want to perform a LookupEx() such that the matching_column argument depends on the value in this key column.
Example 1) The key column contains the value ID123. The LookupEx() function should search for ID123 in column A of table B, and return the value(s) in column C.
Example 2) The key column contains the value SPREAD. The LookupEx() function should search for SPREAD in column D of table B, and return the value(s) in column C.
Since a LookupEx() function cannot be used within an If() function, how might I accomplish this?