Forum Discussion

mrush142's avatar
mrush142
Copper Contributor
Oct 26, 2023
Solved

Need a lookup function for multiple columns and rows

Hello, have a problem I am trying to figure out. So I need a function that uses two columns as the lookup (column X & W) and based on the m (column O, P, or Q) with the id (column N) give me a r (column R, S, or T). This is how my data is presented and I know it is not ideal.

Any help is greatly appreciated!

  •  

    =INDEX($R$3:$T$5,XMATCH(X3,$N$3:$N$5,0),XMATCH(W3,XLOOKUP(X3,$N$3:$N$5,$O$3:$Q$5),0))

    Messed around and found a solution! Thanks you SergeiBaklan for the help

    • mrush142's avatar
      mrush142
      Copper Contributor
      When you say mN and rN column, am I supposed to select each columns?

      =XLOOKUP(X3&"="&W3,$N$3:$N$5&"="&$O$3:$Q$5,$R$3:$T$5)

      The id column needs to be combined with the m column then look up in the other id column combined with whichever mN column (m1, m2, m3) that is the same as the m lookup column. Then return which ever rN value
      • mrush142's avatar
        mrush142
        Copper Contributor

         

        =INDEX($R$3:$T$5,XMATCH(X3,$N$3:$N$5,0),XMATCH(W3,XLOOKUP(X3,$N$3:$N$5,$O$3:$Q$5),0))

        Messed around and found a solution! Thanks you SergeiBaklan for the help

Resources