I have a table with User IDs in one column. These are entered multiple times to show the result for a particular topic.
ID Topic Pass/Fail
71086686 Science P
71086686 Maths P
71086686 Tech P
71086686 ICT F
71086687 Science P
71086687 Maths P
71086687 Tech P
71086687 ICT F
I am trying to find a way to return the Pass/Fail result for a particular ID and topic.
I am trying to use VLOOKUP to do this but cant work out how to use multiple columns as values to look up against.
essentially i am trying to acheive the below:
Vloookup([ID] and [Topic], A:C, 3, FALSE)
I don't recommend to concatenate criteria and searchranges when you could use INDEX
& MATCH
combo.
=INDEX(C2:C9,MATCH(1,(A2:A9=Criteria1)*(B2:B9=Criteria2),0))
And confirm through CtrlShiftEnter
Implement another INDEX
if you want to remove the array entering:
=INDEX(C2:C9,MATCH(1,INDEX((A2:A9=Criteria1)*(B2:B9=Criteria2),0),0))
You can add another column with a formula A2&B2
, then use Vlookup to find that value.
Let's say you add it in the new column A.
Then your formula to find the value would look like this:
Vloookup([ID] & [Topic], A:D, 4, FALSE)
I use this to quickly find values that I need without typing long formulas.
来源:https://stackoverflow.com/questions/57038224/vlookup-based-on-two-column-values