Forum Discussion

Dejongbrian's avatar
Dejongbrian
Copper Contributor
Dec 21, 2022

Vertical search multiple values

Hey,

 

I have a little problem and I can’t get the formule to work.

       A        B          C

1 Bob       10      Januari  

2 Bob       20      Februari

3 Bob       30      March 

4 Ann       10      Januari

5 Ann       20      Februari 

6 Ann       30      March 

 

     A         B         C

1 Bob      30

2 Ann      20

 

The cells in column C has to have a formula that says: March for Bob 30 and februari for Ann 20.

 

Thanks for the help!

 

  • MY's avatar
    MY
    Brass Contributor

    So to make it less confusing let's say it's
         D    E    F
    1 Bob 30
    2 Ann 20

    In F1 (Excel 365):
    =XLOOKUP(D1&E1,A1:A6&B1:B6,C1:C6)

    In F1:
    =INDEX(C1:C6,MATCH(D1&E1,A1:A6&B1:B6,0))

  • Dejongbrian 

    =INDEX(sheet1!$C$1:$C$6,MATCH(1,(sheet2!A1=sheet1!$A$1:$A$6)*(sheet2!B1=sheet1!$B$1:$B$6),0))

     

    If the sheetnames are "sheet1" and "sheet2" you can enter this formula in cell C1 of sheet2. Enter the formula with ctrl+shift+enter if you don't work with Office365 or Excel 2021.

Resources