Use this formula
=XLOOKUP(E2,A2:A4,B2:B4,"Unknown")The example below uses the column letters and row numbers in the formula. Enter it in a blank cell after the sample data.
See the cells and result
Example data
| Row | Postal prefix | Zone | Find prefix | ||
|---|---|---|---|---|---|
| 2 | NE | Zone 1 | SW | ||
| 3 | SW | Zone 2 | |||
| 4 | NW | Zone 3 |
Expected result: Zone 2.
Why it works
XLOOKUP finds the prefix in column A and returns its mapped zone from column B.
Excel versions and testing
Microsoft 365, Excel 2021, or Excel 2024. XLOOKUP is unavailable in Excel 2016 and 2019.
This original example has been checked against the browser formula engine and the downloadable workbook structure. The workbook has not been verified in every Excel edition. Microsoft function reference.
Common mistake and fix
If #NAME? appears, check your Excel version. In Excel 2016 or 2019, use INDEX and MATCH for an equivalent lookup. If the result is missing, check spaces in the lookup value.
Try it yourself
Change a number or label in the data and predict the new result. Use the practice lab to test a supported formula, or download the data to work in Excel.
Try this example onlineDownload Excel workbookDownload CSV