How to Implement VLOOKUP in Excel
In this article
VLOOKUP finds a value in the first column of a table and returns something from the same row. You implement it by writing a formula in the form =VLOOKUP(lookup_value, table_array, col_index_num, FALSE), where the lookup value is the thing you know, the table array is the range you want to search, the column index tells Excel which column of that range to return, and FALSE tells Excel to accept only an exact match. Type it in a cell, press Enter, and drag the fill handle down to apply it to the rest of your list. For most everyday lookups that is the whole job; the rest of this guide covers the parts that trip people up.
VLOOKUP works in every current version of Excel for Windows, Mac, and the web, though labels and the exact look of dialogs can differ slightly by version, device, and region.
What You'll Need
- A spreadsheet with at least two tables: one that holds the lookup value you already know, and one reference table where the answer lives.
- The lookup column must be the leftmost column of the reference table, because VLOOKUP cannot look to the left of where it searches.
- Clean matching data: no stray spaces, no numbers stored as text, no inconsistent capitalisation in a list of codes.
- A clear idea of which column number contains the answer you want, counting the first column of your range as 1.
Step-by-Step
- Identify what you know and what you want. Write down the value you already have (for example a product code) and the value you want to pull back (for example the product name). These two decide the first argument and the return column.
- Arrange the reference table. Put the column you will search on the left, with the answer columns to its right. If your reference table has the answer on the left and the key on the right, either rearrange it or use INDEX and MATCH instead, since VLOOKUP cannot read leftwards.
- Confirm the data types match. Click a lookup value in each table and check the alignment: text sits on the left of a cell, numbers on the right. A product code stored as text in one table and as a number in the other will never match. Select the column of numbers stored as text, use the warning icon to convert to number, or clean them with
TRIMandVALUEin a helper column. - Click the cell where the answer should appear and type
=VLOOKUP(to start. - Enter the lookup value. Click the cell holding the value you know, or type a fixed value. The cell reference makes the formula copyable down a column; a typed value locks it to one answer.
- Enter the table array. Select the reference range. Include the lookup column and every column you might return from, but exclude header rows. Press F4 (on some Mac keyboards, Fn+F4) to add dollar signs and make the range absolute, for example
$A$2:$D$500. This is the single most common omission: without it, copying the formula down shifts the reference and later rows return the wrong answers. - Enter the column index. Count from the left edge of the range you just selected, starting at 1. If your selection begins at column A and the answer is in column C, the index is 3.
- Enter FALSE for an exact match. Close the bracket and press Enter. Always use FALSE for lists of codes, names, SKUs, or IDs. TRUE is a legacy approximate-match mode that requires a sorted table and silently returns wrong results on unsorted data, so avoid it unless you deliberately need banded lookups such as tax brackets.
- Check the first result by eye. Find the same record in the reference table and confirm the returned value is the one in the matching row. This single check catches almost every column-index error.
- Copy the formula down. Use the fill handle or copy and paste. If your lookup values are in a single column and the return values span several columns, make the column index relative so it shifts as you drag sideways, or wrap the whole formula so copying stays predictable.
- Handle misses gracefully. Wrap the formula in IFERROR so blank or unmatched rows show something readable instead of
#N/A:=IFERROR(VLOOKUP(A2,$A$2:$D$500,3,FALSE),"Not found"). Produce a clear blank or message rather than a zero, which can corrupt downstream totals. - Verify the whole column. Filter for errors and for unexpected blanks. A value that should exist but returns
#N/Anearly always means a stray space, a data type mismatch, a hidden row inside your range, or a lookup value that genuinely is absent from the reference table.
Common Mistakes
- Forgetting the absolute reference. The range shifts when you copy the formula down, so row fifty searches the wrong block of cells.
- Miscounting the column index. Counting from column A rather than from the left edge of the selected range is the second most common error. Count from the first selected column.
- Using TRUE or leaving the fourth argument blank. Excel then assumes approximate match and can return a plausible but wrong neighbour value.
- Trailing spaces.
"SKU123"and"SKU123 "look identical and never match. UseTRIMon both sides. - Numbers stored as text. Imported data from CSV files is a frequent culprit; the value aligns left instead of right.
- Text case and formatting differences. VLOOKUP ignores case, so capitalisation is rarely the problem, but formatting such as a leading apostrophe is.
- Duplicates in the lookup column. VLOOKUP returns the first match only and gives no warning that other matches exist.
- Looking to the left. If the answer sits left of the key, VLOOKUP cannot reach it.
Tips
- Name your reference range (Formulas > Define Name) and use the name in the formula; it is easier to read and does not shift.
- Convert the reference table to an Excel Table so the range grows automatically as you add rows, and use structured references in the formula.
- Prefer XLOOKUP where it is available in your Excel version: it looks in both directions, defaults to exact match, and needs no column counting.
- Use INDEX and MATCH as the portable alternative when you cannot rearrange columns or need a leftward lookup.
- Keep key columns free of merged cells, which break ranges and matching.
- Document in a comment what each formula looks up, so the next person editing the sheet does not break it.
Troubleshooting
If every result is #N/A, test one lookup value against the reference table directly: paste the value into a blank cell, then use =COUNTIF(reference_range, value). A result of 0 confirms the value really is not an exact match, which points to spaces, text-versus-number storage, or a truncated value. Clean both sides and retry.
If only some rows fail, the likely cause is a relative range that slipped when copied. Click a failing formula and watch which cells the coloured outlines cover; compare with a working row above. If the reference and lookup columns look identical but still fail, check for non-printing characters with CLEAN in addition to TRIM.
If the formula returns #REF!, the column index is larger than the number of columns in the range, or a referenced sheet or column was deleted. Recount the columns and re-select the range.
If it returns #VALUE!, the column index is not a number, usually because it was typed with quotes around it.
If answers look right but subtly wrong, look for approximate match left on (fourth argument missing) or a sorted assumption in unsorted data. Switch to FALSE and recheck.
If results are correct in one workbook but fail in another, check whether one file stores keys as numbers and the other as text, especially after importing CSV data.
If performance drags on a very large sheet, restrict the range to the used rows rather than whole columns, and avoid repeating the same lookup many times.
If nothing at all happens when you press Enter, the cell may be formatted as Text; set the format to General and retype the formula.
Frequently Asked Questions
Does VLOOKUP work in Excel for the web and on Mac?
Yes. The formula and its arguments are the same across platforms. Only interface details differ.
Can VLOOKUP return a value from a column to the left?
No. The lookup column must be leftmost in the range. Use XLOOKUP where available, or INDEX and MATCH.
What is the difference between TRUE and FALSE in VLOOKUP?
FALSE forces an exact match. TRUE finds the closest match below the value and requires a sorted first column, so use it only for deliberate banded lookups.
Why does my VLOOKUP return #N/A when the value is clearly there?
Almost always hidden spaces, a text-versus-number mismatch, or a lookup value that is not an exact match. Test with COUNTIF to confirm.
Can VLOOKUP work across two different workbooks?
Yes, but the second workbook must stay open or be referenced by its full path, and links break if the file is moved or renamed.
What happens if there are duplicate keys?
VLOOKUP returns only the first match it encounters and does not flag the others, so duplicates can quietly produce misleading results.