Skip to content
AnIntent

How to Use VLOOKUP in Excel: Syntax, Examples and Error Fixes

The VLOOKUP syntax Microsoft documents, three working example formulas, a typo to avoid, the formula mistakes to fix when a lookup fails, and when Microsoft points you to XLOOKUP instead.

AnIntent Editorial · · 3 min read

Hands typing on a laptop displaying a data spreadsheet
Photo by Gorilla ROI Data Connector on Unsplash
In this article
  1. The four arguments VLOOKUP takes
  2. Three example formulas you can adapt
  3. The typo to avoid when copying Microsoft's examples
  4. Fixing a VLOOKUP that returns #N/A, #REF! or #VALUE!
  5. When to use XLOOKUP instead
  6. What to check on Microsoft's page before you rely on TRUE
Share this article

This guide gives you the VLOOKUP syntax as Microsoft documents it, three example formulas you can adapt, and the formula mistakes to fix when a lookup returns an error. It is deliberately short and covers only what Microsoft's own help page confirms.

The four arguments VLOOKUP takes

Microsoft's VLOOKUP help page gives the syntax as:

VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])

In order, these are:

  1. lookup_value: what you are searching for. This can be a cell reference or text in quotes.
  2. table_array: the range to search.
  3. col_index_num: the column number within that range whose value you want back.
  4. range_lookup: in Microsoft's examples, this is TRUE or FALSE.

Three example formulas you can adapt

These examples come from Microsoft's VLOOKUP page.

Look up a cell value with TRUE

=VLOOKUP(A2,A10:C20,2,TRUE)

This looks up the value in A2 within A10:C20 and returns from column 2 of that range. The last argument is TRUE.

Look up a piece of text with FALSE

=VLOOKUP("Fontana",B2:E7,2,FALSE)

The lookup value is typed text, so it goes in double quotes. The search range is B2:E7, the result comes from column 2 of that range, and the last argument is FALSE.

Look up from another sheet

=VLOOKUP(A2,'Client Details'!A:F,3,FALSE)

The range points at columns A to F on a sheet named Client Details. The sheet name contains a space, so it sits inside single quotes, followed by !. The result comes from column 3.

The typo to avoid when copying Microsoft's examples

Don't paste that one as-is. Write FALSE in full, and put any typed text in double quotes, the way the "Fontana" example does.

Fixing a VLOOKUP that returns #N/A, #REF! or #VALUE!

Go through these fixes in order:

  • Spell the last argument in full. A misspelling like the FLASE in one of Microsoft's own examples won't work, so retype it.
  • Quote typed text. If you type the lookup value instead of pointing at a cell, wrap it in double quotes: "Fontana", not Fontana.
  • Quote sheet names that contain spaces. Write 'Client Details'!A:F, with single quotes around the name and ! after it.
  • Keep the column number inside the range. col_index_num counts columns within table_array, not across the whole sheet. In =VLOOKUP(A2,A10:C20,2,TRUE), column 2 means column B, because the range starts at column A.
  • Check the value is really there. Make sure what you are looking for actually appears in the range you gave, not in a column outside it.

If the formula still fails after those fixes, Microsoft keeps a separate help page for each of these errors, linked from the main VLOOKUP page. For #N/A, its guide on how to correct a #N/A error covers the remaining causes.

When to use XLOOKUP instead

Microsoft's VLOOKUP page describes XLOOKUP as an improved version. According to the page, XLOOKUP works in any direction and returns exact matches by default. If your Excel has it, it is the function Microsoft points you to. Our guide on how to use XLOOKUP in Excel walks through it.

What to check on Microsoft's page before you rely on TRUE

This guide doesn't explain how TRUE and FALSE behave differently. It also doesn't cover which Excel versions support each function, or Google Sheets. Microsoft's VLOOKUP help page has the full argument descriptions and remarks, so read those before you use TRUE on real data. For lookups that VLOOKUP can't handle, Microsoft also has a page on looking up values with VLOOKUP, INDEX or MATCH.

Common questions

What is the VLOOKUP syntax?

Microsoft gives it as VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup]).

How do I use VLOOKUP on another sheet?

Put the sheet name before the range, in single quotes if it has spaces, as in Microsoft's example =VLOOKUP(A2,'Client Details'!A:F,3,FALSE).

How do I fix a VLOOKUP that returns #N/A?

First check the formula itself: spell FALSE or TRUE in full, put typed text in double quotes, put single quotes around sheet names with spaces, make sure the column number counts within your range, and confirm the value you want is actually in that range. If it still fails, Microsoft has a dedicated page on how to correct a #N/A error, and separate pages for #REF! and #VALUE! are linked from its VLOOKUP help page.

Should I use XLOOKUP instead of VLOOKUP?

Microsoft describes XLOOKUP as an improved version that works in any direction and returns exact matches by default.

A close up of a hard drive in a case
Buying guide

How to Choose an M.2 SSD for PS5: Check Heatsink Height Before Speed

Sony's PS5 SSD rules, explained: which specs matter, why heatsink thickness trips people up, and why you needn't pay for speed beyond 5,500 MB/s.

· 6 min

Keep reading