Advanced lookup function that replaces VLOOKUP, HLOOKUP, and INDEX-MATCH. Searches both vertically and horizontally. Does not require sorting like VLOOKUP.
Scenario | Formula | Result |
---|---|---|
Find the name of Employee ID 102 | =XLOOKUP(102, A2:A5, B2:B5) | Sara |
Find the salary of Employee ID 103 | =XLOOKUP(103, A2:A5, C2:C5) | 55,000 |
Find the name of an employee using an ID in E1 | =XLOOKUP(E1, A2:A5, B2:B5, "Not Found") | If E1 = 104, Result: "Zainab" |
Find the salary of the closest lower ID (Approximate Match) | =XLOOKUP(103.5, A2:A5, C2:C5, "Not Found", -1) | 55,000 |
Find the salary of the closest higher ID | =XLOOKUP(103.5, A2:A5, C2:C5, "Not Found", 1) | 58,000 |
Find an employee’s name using a partial match (Wildcard Search) | =XLOOKUP("*Ali*", B2:B5, A2:A5, "Not Found", 2) | 101 |
Check if an employee exists in the table | =IF(ISNA(XLOOKUP(105, A2:A5, B2:B5, "Not Found")), "Not in List", "In List") | If 105 is not in the table, Result: "Not in List" |
Dynamic lookup for an employee’s salary based on an ID in E1 | =XLOOKUP(E1, A2:A5, C2:C5, "Not Found") | If E1 = 102, Result: 60,000 |
Find the highest salary using MAX with XLOOKUP | =MAX(XLOOKUP(A2:A5, A2:A5, C2:C5)) | 60,000 |