Forum Discussion

AG91983's avatar
AG91983
Copper Contributor
May 16, 2022

Vlookup to multiple columns

Hello! 

 

I was wondering if there was a formula to do a vlookup referencing 2 different columns? In the below example I have 2 tabs of data; on tab 1 I want to do a vlookup based off of column C however on Tab 2 the "month" can be found in either column G or H. Is there a formula that says vlookup column c and look to column G and H and return the result of I? Thank you! 

 

 

5 Replies

    • DPATELKOP's avatar
      DPATELKOP
      Copper Contributor

      Sp. THANKS FOR UOLOADING DEMO FILE. LOVED THIS SOLUTION. WORKED LIKE A CHARM FOR ME. BEAUTY IS I COULD CHANGE THE RANGE OF INPUT DATA AFTER COPY/PASTE IN ANY EXCEL FILE & WORK ON IT.

  • AG91983 

    =INDEX($I$4:$I$9,MATCH(1,MMULT(1*(C4=$G$4:$H$9),ROW($1:$2)^0),0))
    =VLOOKUP(C4,CHOOSE({1,2},$G$4:$G$9&$H$4:$H$9,$I$4:$I$9),2,0)

    An alternative could be INDEX / MATCH or VLOOKUP. Enter either formula with ctrl+shift+enter if you don't work with Office365 or 2021.

  • flexyourdata's avatar
    flexyourdata
    Iron Contributor

    AG91983 

     

    You can use INDEX/MATCH, like this:

     

    =INDEX($I$4:$I$9,MATCH(C4,$G$4:$G$9&$H$4:$H$9,0),)

     

    Or XLOOKUP:

     

     

    =XLOOKUP(C4,$G$4:$G$9&$H$4:$H$9,$I$4:$I$9)