Search code examples
google-sheetsgoogle-sheets-vlookup

How to search in multiple columns in google sheets?


I have several columns as follows:

Nugegoda  Branch    Nugegoda Branch REF     Malabe Branch   Malabe Branch REF   
102                 2222                    103             33333   
201                 2222                    203             33333   
301                 2222                    303             33333   
401                 2222                    403             33333   
501                 2222                    503             33333   
                

enter image description here

I have named those ranges as Nugegoda and Malabe. I want to write a VLOOKUP for key 103 searching in both of these ranges together, how can I do that?


Solution

  • You can also try

    =IFERROR (VLOOKUP(103, {$B$2:$C; $E$2:$F; $H$2:$I}, 2, FALSE))
    

    or

     =IFERROR (VLOOKUP(L1, {$B$2:$C; $E$2:$F; $H$2:$I}, 2, FALSE))