Home > other >  How to Vlookup a cell while matching another cell
How to Vlookup a cell while matching another cell

Time:06-14

Im Trying to Vlookup a vehicle plate number and if it matches by the date of entry, it should and get its Gallons. Here is what i am trying :

=VLOOKUP(E2,B2:B3,MATCH(F1,A2:A3,FALSE),FALSE)

So basically if plate 151 will match then it should match the date above (02-01-20) and return the value "10" in G2

I have tried this but it return #N/A

=VLOOKUP(E2,Data,MATCH(F1,A2:A3,0),0)

Data is the table name

enter image description here

CodePudding user response:

Try using Xlookup by combining the search criteria $F$1&E2 And the search range A2:A3&B2:B3

 =XLOOKUP($F$1&E2,A2:A3&B2:B3,C2:C3,"",0,1)

enter image description here

  • Related