0Pricing
Excel Formulas Academy · Lesson

The XLOOKUP Syntax

Learn the lookup value, lookup array, and return array arguments.

The XLOOKUP Syntax is a free Excel Formulas Academy lesson on CoddyKit — lesson 1 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Excel Formulas Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

Meet XLOOKUP

XLOOKUP is the modern replacement for VLOOKUP and HLOOKUP. It finds a value in one column (or row) and returns the matching value from another.

Its biggest win: you tell it where to search and what to return as two separate ranges. No counting columns, no worrying about which side your answer sits on.

XLOOKUP is available in Excel 365, Excel 2021, and Google Sheets.

The Three Core Arguments

The simplest XLOOKUP needs just three pieces of information:

  • lookup_value - what you are searching for
  • lookup_array - the range to search in
  • return_array - the range to pull the answer from

Read the formula as: find this value, in this column, and give me the matching item from that column.

=XLOOKUP(lookup_value, lookup_array, return_array)

A First Worked Example

Imagine a product list. Column A holds product names and column B holds prices. You want the price of "Keyboard".

You search for the name in A2:A20 and return the price from B2:B20. XLOOKUP scans the lookup array, finds "Keyboard", then returns whatever sits in the same row of the return array.

=XLOOKUP("Keyboard", A2:A20, B2:B20)

Referencing a Cell Instead of Text

Hard-coding "Keyboard" inside the formula is fragile. It is far better to point the lookup value at a cell.

If the user types the product name into D2, your formula reacts automatically when they change it. This is how live lookup tools and dashboards work.

=XLOOKUP(D2, A2:A20, B2:B20)

Lookup and Return Must Line Up

The lookup array and return array should have the same height (same number of rows). XLOOKUP matches them row by row.

If A2:A20 is 19 rows, the return array must also be 19 rows. A mismatch produces a #VALUE! error because XLOOKUP cannot pair the rows correctly.

=XLOOKUP(D2, A2:A20, B2:B20)

Returning From a Different Column

The return array does not have to be next to the lookup array. Suppose names are in column A but you want the stock count in column E.

Just point the return array at E2:E20. XLOOKUP does not care about the gap between columns, unlike VLOOKUP which counts columns rightward.

=XLOOKUP(D2, A2:A20, E2:E20)

Exact Match Is the Default

One of the friendliest things about XLOOKUP is that it looks for an exact match by default.

VLOOKUP defaulted to approximate match, which silently returned wrong answers when people forgot the final FALSE. XLOOKUP flips this: you get the exact match unless you deliberately ask for something else.

=XLOOKUP(D2, A2:A20, B2:B20)

Looking Up Across a Row

XLOOKUP also handles horizontal data. If month names sit across row 1 and sales sit across row 2, you can search the row instead of a column.

The same formula structure works: lookup value, the row of months, the row of sales. One function replaces both VLOOKUP and HLOOKUP.

=XLOOKUP("Mar", B1:M1, B2:M2)

Using It Inside Other Formulas

Because XLOOKUP returns a single value, you can drop it straight into a calculation.

For example, multiply a looked-up unit price by a quantity in E2. The lookup runs first, returns the price, and the multiplication uses that result. This keeps your sheet compact and readable.

=XLOOKUP(D2, A2:A20, B2:B20) * E2

Whole-Column References

You can use full-column references like A:A and B:B so the formula keeps working as new rows are added.

This is convenient, but on very large sheets it can be slightly slower. For tidy data, referencing the exact range or an Excel Table is a good habit.

=XLOOKUP(D2, A:A, B:B)

Why XLOOKUP Wins

Compared with VLOOKUP, XLOOKUP is:

  • Direction-free - return columns can be left or right of the lookup
  • Safer - exact match by default
  • Stable - inserting columns does not break it
  • Simpler - no column-index counting

Once you learn the three core arguments, most everyday lookups become effortless.

=XLOOKUP(D2, A2:A20, B2:B20)

Quick Check

Test your understanding of the basic XLOOKUP syntax.

Recap: XLOOKUP Basics

You learned the three core arguments of XLOOKUP:

  • lookup_value - what to find
  • lookup_array - where to search
  • return_array - what to return

It defaults to an exact match, the return range can sit anywhere, and it works across both columns and rows. Next you will make it handle missing values gracefully.

=XLOOKUP(D2, A2:A20, B2:B20)

Frequently asked questions

Is the “The XLOOKUP Syntax” lesson free?

Yes — the full text of “The XLOOKUP Syntax” is free to read here on the web, and the Excel Formulas Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Excel Formulas Academy course, upgrade to CoddyKit PRO.

What will I learn in “The XLOOKUP Syntax”?

Learn the lookup value, lookup array, and return array arguments. You practise Excel Formulas Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start Excel Formulas Academy?

No prior experience is required. Excel Formulas Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 1 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “The XLOOKUP Syntax” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this Excel Formulas Academy lesson?

Yes. Every Excel Formulas Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. The XLOOKUP Syntax
  2. Handling Misses With if_not_found
  3. Searching Left and From the Bottom
  4. Returning Whole Rows or Columns
← Back to Excel Formulas Academy