soldier2gud4me
soldier2gud4me

Reputation: 79

How to Vlookup a cell while matching another cell

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

Upvotes: 2

Views: 39

Answers (1)

W_O_L_F
W_O_L_F

Reputation: 1486

Try using Xlookup by combining the search criteria $F$1&E2 And the search range $A$2:A3&$B$2:B3

 =XLOOKUP($F$1&E2,$A$2:A3&$B$2:B3,C2:C3,"",0,1)

enter image description here

Upvotes: 2

Related Questions