=XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode])
| Argument | Required | Description |
|---|---|---|
| lookup_value | Required | The value you are searching for. Can be a cell reference, a typed value, or a formula result. Data types must match the lookup column — numbers do not match text versions of the same number. |
| lookup_array | Required | The column or row to search in. This is a single column or row, not an entire table. XLOOKUP searches this range for your lookup_value. |
| return_array | Required | The column or range to return values from. Can be to the left or right of lookup_array, on another sheet, or even span multiple columns to return several values at once. |
| if_not_found | Optional | What to return when no match is found. Use an empty string to return a blank, a word like Not found, or any value. Without this argument XLOOKUP returns #N/A when the value is missing. |
| match_mode | Optional | 0 for exact match (default). -1 for exact or next smaller. 1 for exact or next larger. 2 for wildcard match. Most lookups use 0. |
| search_mode | Optional | 1 to search from first to last (default). -1 to search from last to first which is useful for finding the most recent match. |
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Lookup Code | Product Code | Product Name | Price | Result |
| 2 | PRD-003 | PRD-001 | Wireless Mouse | 29.99 | =XLOOKUP(A2,B2:B11,D2:D11,"Not found") |
| 3 | PRD-002 | USB Keyboard | 45.99 | ||
| 4 | PRD-003 | Monitor Stand | 89.50 | 89.50 | |
| 5 | PRD-004 | Laptop Bag | 59.99 | ||
| 6 | PRD-005 | HDMI Cable | 12.99 | ||
| 7 | PRD-006 | Webcam HD | 79.00 | ||
| 8 | PRD-007 | Desk Lamp | 34.50 | ||
| 9 | PRD-008 | USB Hub | 27.99 | ||
| 10 | PRD-009 | Mouse Pad XL | 19.99 | ||
| 11 | PRD-010 | Headset Pro | 129.00 |
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Lookup Code | Product Code | Product Name | Category | Name Result | Category Result |
| 2 | PRD-005 | PRD-001 | Wireless Mouse | Peripherals | =XLOOKUP(A2,B2:B11,C2:D11) | |
| 3 | PRD-002 | USB Keyboard | Peripherals | |||
| 4 | PRD-003 | Monitor Stand | Accessories | |||
| 5 | PRD-004 | Laptop Bag | Accessories | |||
| 6 | PRD-005 | HDMI Cable | Cables | HDMI Cable | Cables | |
| 7 | PRD-006 | Webcam HD | Peripherals | |||
| 8 | PRD-007 | Desk Lamp | Accessories | |||
| 9 | PRD-008 | USB Hub | Cables | |||
| 10 | PRD-009 | Mouse Pad XL | Accessories | |||
| 11 | PRD-010 | Headset Pro | Peripherals |
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Find Employee | Employee | Clock-in | Last Login |
| 2 | EMP-002 | EMP-001 | 08:02 | =XLOOKUP(A2,B2:B11,C2:C11,"No record",0,-1) |
| 3 | EMP-003 | 07:45 | ||
| 4 | EMP-002 | 09:10 | ||
| 5 | EMP-001 | 08:55 | ||
| 6 | EMP-002 | 08:30 | ||
| 7 | EMP-004 | 07:58 | ||
| 8 | EMP-003 | 09:22 | ||
| 9 | EMP-002 | 10:15 | 10:15 | |
| 10 | EMP-001 | 07:40 | ||
| 11 | EMP-004 | 08:05 |
=XLOOKUP(A2,HR!B:B,HR!F:F,"Not found")
=XLOOKUP(A2,Products!A:A,Products!B:C)
=XLOOKUP(A2,TXN!A:A,TXN!D:D,"None",,,-1)
=XLOOKUP(A2,Rates!A:A,Rates!B:B,,1)
=XLOOKUP("*"&A2&"*",Codes!A:A,Codes!B:B,"Not found",,2)
=XLOOKUP(A2,D:D,F:F,"Not found")
=XLOOKUP(A2,D:D,E:G)
=XLOOKUP(A2,D:D,F:F,"None",0,-1)