Search code examples
arraysgoogle-sheetsgoogle-sheets-formulamatchvlookup

How to get criteria column dynamically using INDEX+VLOOKUP in Sheets?


One good soul has helped me get to this point, but I got one more contraint I'm trying to tackle:

How to populate Rep and Region based on the ID column, but this column may move, so getting this must be dynamic, just like getting Rep and Region columns is.

Here's the working formula, without the criteria:

=INDEX(VLOOKUP(ROW('From Sheet1'!A7:A); {ROW('From Sheet1'!A7:A)\ 'From Sheet1'!B7:C}; MATCH({"Rep"\ "Region"}; 'From Sheet1'!A7:C7; 0); 0))

Here's a sample data.

Appreciate your help, as usual!


Solution

  • try:

    =INDEX(IFNA(VLOOKUP(A7:A, 
     {FILTER('From Sheet1'!A7:Z, 'From Sheet1'!7:7="ID"), 'From Sheet1'!B7:C}, 
     MATCH({"Rep", "Region"}, 'From Sheet1'!A7:C7), 0)))
    

    enter image description here