Look Up Values Left or Right with XLOOKUP

In Formulas•By M. Ichsanul Fadhil•Updated 2026-12-02

Ever spent ten minutes rearranging columns just because VLOOKUP refused to look to the left—only to have someone insert a new column a week later and silently break your report? XLOOKUP solves both headaches by letting you pick your lookup and return ranges separately.

Step1

See Why VLOOKUP Breaks on Left or Inserted Columns

Department sits to the left of Emp ID where VLOOKUP cannot reach

In our HR table, Department sits in Column A while Emp ID is in Column B, so VLOOKUP returns #N/A right away. Even when the return column is on the right, VLOOKUP relies on a static column number like 3 that breaks the moment a column is inserted.

FeatureVLOOKUPXLOOKUP
Lookup directionRight onlyLeft, right, or horizontal
Inserting a columnBreaks column indexUpdates automatically
Default match modeApproximate (needs FALSE)Exact match by default
Missing valueReturns #N/ABuilt-in [if_not_found]
Step2

Pick Lookup and Return Arrays Separately

Type =XLOOKUP(C2, B2:B4, A2:A4) in cell D2 with full tooltip visible

Click D2 and type =XLOOKUP(C2, B2:B4, A2:A4). You select the Lookup ID (C2), the Emp ID column (B2:B4), and the Department column (A2:A4)—even though it's on the left.

Notice you don't have to type FALSE or 0 at the end: XLOOKUP defaults to an exact match automatically.

Step3

Add a Built-In Fallback for Missing IDs

Add Not Found fallback and drag down D2:D4

Add a comma and type "Not Found" as the fourth argument so your formula reads =XLOOKUP(C2, B2:B4, A2:A4, "Not Found"). Press Enter and drag it down through D4—missing IDs like E999 show Not Found cleanly without wrapping everything in IFERROR.

Step4

Look Up Horizontally Without HLOOKUP

Horizontal XLOOKUP replacing HLOOKUP across Q1 to Q4

XLOOKUP isn't limited to vertical columns. If your headers run across a row—like Q1 through Q4 in A1:D1 with revenue below in A2:D2—the exact same formula =XLOOKUP(A4, A1:D1, A2:D2) looks horizontally and replaces HLOOKUP too.

Conclusion

Once you switch to XLOOKUP, you stop rearranging tables just to make a lookup work. It searches left, right, or horizontally across rows, defaults to an exact match automatically, and never breaks when someone inserts a column.

Adding that fourth argument—like "Not Found"—also keeps your reports clean without needing extra IFERROR wrappers.

Share:

Try It Live in the Sheet

Loading Spreadsheet Playground...Initializing calculation engine
Try It Live Click anywhere to practice with pre-loaded data
Real-World Scenario

Your HR directory lists Department to the left of Emp ID, which breaks classic VLOOKUP right out of the gate.

Use XLOOKUP in D2:D4 to pull the matching department for each Lookup ID, and make sure missing IDs like E999 show Not Found instead of an #N/A error.

Objectives
#1In D2 and D4, use XLOOKUP to return the matching Department (Sales, HR) for E102 and E103.
#2In D3, use XLOOKUP with its if_not_found argument so missing ID E999 returns "Not Found".

Discussion & Questions

Be kind and constructive.
Loading discussion...

You Might Also Like