Forum Discussion
Vlookup with If And statement
VLOOKUP is awkward because you have three criteria rather than one key. Use XLOOKUP with Boolean multiplication. Assuming Spreadsheet A has participant in A, event in C, time in G, and class in H, the pattern is:
=XLOOKUP(1,(A!$A$2:$A$1000=$C$2)(A!$C$2:$C$1000=$C$3)(A!$H$2:$H$1000=$C$4),A!$G$2:$G$1000,"")
Replace C3 with the cell containing the required event. Each comparison returns TRUE or FALSE; multiplying them produces 1 only for a row matching rider, event, and class. The final empty string keeps the result blank when no match exists.
If more than one row can meet all three conditions, XLOOKUP returns only the first. In that case, use FILTER with the same three conditions to return every matching time. Also ensure participant numbers have the same data type on both sheets; a text value such as "0012" will not match numeric 12. Converting the ranges to Excel Tables will make the formula easier to read and include new records.