Search code examples
arraysgoogle-sheetsgoogle-sheets-formulavlookupindex-match

match a range on query function in google sheets


I am trying to create an arrayformula that matches the column from a certain sheet to the current sheet. I have a list of names (Column B) in sheet1 with its value (Column C), and in sheet2 i have all the names in a different order, and i want to bring their respective values to the current sheet, i have tried the following formula but it only matches the first value which is A2 and not the rest to the A14

=ARRAYFORMULA({"Match";IF(ISBLANK(A2:A14),"",IFERROR(QUERY(Sheet1!$B$2:$C$14, "select C where B matches '"&A2:A&"' "),0))})

Any help will be very much appreciated.

Link to the sheet


Solution

  • use:

    =INDEX(IFNA(VLOOKUP(A2:A, Sheet1!B:C, 2, )))
    

    enter image description here