🚀 New batches open: Advanced Excel • Power BI • SQL • AI for Analytics — Book a free demo

Day 8 — VLOOKUP and why it disappoints

The function everyone lists on their CV. Worth knowing properly — including the three things it cannot do.

What VLOOKUP does

You have a value. You want the matching value from another column of the same table. VLOOKUP finds the row and fetches across.

=VLOOKUP(what to find, table, which column number, FALSE)

Every formula on this page runs against the Sales sheet below. The row numbers and column letters are real — F2 really is 165000.

Order 1009 was worth 220,000, came from the West, and was for Laptops. The column number counts from the left edge of the table you gave it, not from column A of the sheet — here column 6 is F because the table starts at A.

Always write FALSE

This is the classic silent disaster FALSE means exact match. Order 1050 does not exist, so it correctly returns #N/A.

TRUE means approximate match — it returns the nearest value below. Ask for order 1050 and it cheerfully hands you order 1015's amount, with no error and no warning. If you leave the fourth argument out entirely, Excel assumes TRUE.

Unless you are deliberately banding numbers, always type FALSE.

Where approximate match is the right tool

Grading, tax slabs, discount bands — anywhere a range of values maps to one result. The lookup column must be sorted ascending.

In practice, for banding, IFS is clearer than an approximate VLOOKUP unless you have many bands stored in their own table.

Handling "not found" properly

IFNA is the more careful choice: it catches "not found" but still lets genuine errors such as #REF! show through, so a broken formula does not disguise itself as a missing record.

Limitation 1 — it only looks right

VLOOKUP searches the first column of your table and returns something to the right of it. It cannot look leftwards.

The first works because the table starts at D, so Product is the first column. The second returns #N/A — it searched column A for "Mouse" and never looked at column D at all.

Limitation 2 — the column number is a hard-coded guess

Six means "the sixth column". Insert a new column anywhere inside that table and the sixth column becomes something else — the formula keeps working and quietly returns the wrong field. Asking for column 7 when only 6 exist gives #REF!.

Limitation 3 — exact means exact

This lesson uses the Raw sheet below — deliberately messy, the way exported data really arrives.

Looking up "amit sharma" fails, because the stored value has spaces around it. Looking up the cell itself works, because it matches itself exactly. This is the number one cause of #N/A in real workbooks, and TRIM is usually the cure.

Your #N/A checklist
  1. Do the two values have the same length? Use LEN.
  2. Is one a number and the other text that looks like a number?
  3. Did you write FALSE?
  4. Is the value actually in the first column of the table?

Tomorrow

INDEX and MATCH solve all three limitations, and XLOOKUP solves them with less typing. VLOOKUP is still worth knowing — you will meet it in every inherited workbook you ever open.

Try these yourself

  1. Look up the region for order 1013.
  2. Look up the product for order 1006.
  3. Ask for order 2000 and confirm you get #N/A, then wrap it so it shows "Missing".
  4. Explain why =VLOOKUP("West",A2:F16,3,FALSE) fails.
  5. On the Raw sheet, look up the city for the code in B4.