Lookup · Excel formula

Look up a shipping zone

XLOOKUP finds the prefix in column A and returns its mapped zone from column B.

Illustrated spreadsheet concept

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

Visual example for Look up a shipping zone with sample rows and expected result

Example data

RowPostal prefixZoneFind prefix
2NEZone 1SW
3SWZone 2
4NWZone 3

Expected result: Zone 2.

Why it works

XLOOKUP finds the prefix in column A and returns its mapped zone from column B.

Check this: Confirm that the lookup text uses the same format as the table.

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