Skip to content

VLOOKUP

VLOOKUP looks for a value in a table's first column and returns the data from another column in that row: =VLOOKUP(E2,A2:C9,3,FALSE).

Select any words here to ask your Maestro about them.

The table is sorted by code, and P‑108 doesn't exist anymore. What does =VLOOKUP("P‑108",A2:C9,3) return?

A corner store with 8 products. Example data.

What it's for: bringing in data from another table: the price for each code on your order list, each customer's name from their number, each employee's branch. It's how you join two tables in Excel, what SQL does with JOIN.

How to use it: it looks in the table's first column, and only to the right. Lock the table with dollar signs ($A$2:$C$9) before you copy the formula down, or it slides. The fourth argument, FALSE, almost always belongs there.

If a code doesn't exist, check what your formula returns: it's an edge case. And compare a few rows by hand, a spot check, before you trust the whole column.

Practice it in Try to make it fail, with a VLOOKUP formula an AI gave you.

How it's used

How to write it

The price for the code in E2

  1. marked: =VLOOKUP(E2,A2:C9,3,FALSE)
  2. E2What you're looking for: the code.
  3. A2:C9The table; the code has to be in its first column.
  4. 3Which of the table's columns it returns: the third, Price.
  5. FALSEAsks for the exact code.
In Spanish-language Excel it's called BUSCARV. In Google Sheets it's VLOOKUP too, with the same arguments.

When to look closer

Insert a column and VLOOKUP switches data

E2 holds P-107

  1. marked: =VLOOKUP(E2,A2:C9,3,FALSE)Gives $3.49, the price.

Your formula gives $3.49. You insert a Brand column between Product and Price. What does it give now?

Ask your Maestro about VLOOKUP

It answers from the free course page closest to this word, the way it answers while you study.

Example

You: What does "VLOOKUP" mean, in plain words?

Your Maestro: I'll explain it with a case of yours: it sticks better than a definition. Which two tables at work do you join with VLOOKUP?

Asking about: Answers from the page "What is exploratory data analysis, and what do I do first with a new table?"

Only this browser keeps what you ask here. How it works

Learn more

  • Edge case

    An input at the edge of what the logic expects, like a code that isn't in the lookup table, to see that it fails the way it should instead of returning a plausible wrong value.

  • Spot check

    Taking a few rows spread across the data (from the start, the middle and the end) and comparing them by hand with what you expect.

  • Pivot table

    A pivot table summarizes a long table in seconds: it groups by the columns you pick and sums, counts or averages another, with no formulas.

  • Database

    A database stores data in connected tables, with rules for each column, so many people and programs can read and change it without stepping on each other.

The whole glossary