The quick answer

Enter 4 inputs — lookup value, table range, column index, match mode — and the generator assembles a correct VLOOKUP with $ locks, quoting and a plain-English recap. Modern Excel users also see the XLOOKUP equivalent. The formula is copy-ready in seconds, and your lookup values never leave the browser.

The most-searched function in Excel

Type VLOOKUP into a search engine and autocomplete finishes the thought: not working, another sheet, N/A errors, exact match. The pattern holds year after year — of the hundreds of functions in Excel's library, this one keeps the search crown because it is the function everyone needs and the one everyone gets burned by.

The scenario is always the same shape: a list of SKUs in one column, a price table on another sheet, several hundred rows needing the right price brought across. In your head it is one motion; at the formula bar it is four arguments, two with famous traps and a column index everyone counts off by one at least once.

This generator is the un-burnable path. Fill in the lookup value, the table range, and the column that has the answer; choose exact or approximate; and out comes a correct VLOOKUP with the fourth argument written out, dollar signs on the range if you'll fill down, and a plain-English recap underneath — "finds SKU-233 in column A of Prices, returns column C, exact match only" — so you can check the formula against the sentence you meant. Copy, paste, done. The haunted autocomplete entries can be someone else's.

A form that writes your lookup

The form asks for the four inputs in the order they matter to you, not the order the function wants them: what to look up, where the table lives, which column holds the answer, and how it should match. The column is picked from a labeled list, so you count headers, not characters.

From those fields it emits the formula with the details that separate a working lookup from a fragile one: the fourth argument always written explicitly (FALSE for exact, TRUE for banded), the range anchored with $ signs for fill-down, sheet references qualified properly, and text lookup values quoted while cell references stay bare. Alongside the formula, the recap sentence states the lookup in business language. That sentence is the feature people don't know they wanted until the first time it says "returns column C" and they realize they meant column D.

For shops on modern Excel, the generator also shows the XLOOKUP equivalent of the same inputs, because migrating the two forms in lockstep beats rewriting under deadline pressure. The XLOOKUP Formula Builder on this site is the dedicated version of that side; this page keeps the VLOOKUP flame for the enormous installed base of workbooks where it remains the lingua franca.

Generating a lookup in five fields

  1. Enter the lookup value

    A literal like SKU-233, or a cell reference like A2 for a fill-down column. The generator quotes literals and leaves references bare — the difference that produces #NAME? when hand-done wrong.

  2. Define the table range

    Type it or click it together: A2:C401, or Prices!$A$2:$C$401 for another sheet. A checkbox anchors it with dollar signs so fill-down doesn't stretch the range row by row.

  3. Pick the return column

    Choose from a list showing column letters and headers where given. The generator computes the index — counting the lookup column as 1 — and shows which letter the number lands on, killing the off-by-one before it ships.

  4. Choose the match mode

    Exact for IDs, names, SKUs — anything where close enough is wrong. Banded for sorted tier tables: commission rates, shipping weights, tax-style brackets.

  5. Copy the formula

    The output box holds the finished VLOOKUP with the recap underneath; one click copies it. The IFNA wrapper is an optional toggle for the "not found" text, quoted and closed for you.

Anatomy of the four arguments

The signature is VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup]). The search column is always the first column of the range — the reason VLOOKUP cannot look left. col_index_num counts from that first column as 1, a numbering scheme that surprises everyone once and then lives in their fingers forever.

range_lookup is the argument with the reputation. FALSE means exact match only, #N/A otherwise. TRUE means approximate: return the row with the largest first-column value less than or equal to the lookup value — a binary-search-shaped behavior that demands an ascending-sorted first column and powers every banded-tier table built since the early 1990s. The trap is the default: omit the argument and Excel behaves as if you typed TRUE. On an unsorted product list, approximate mode doesn't error — it returns the price of whichever SKU happens to sort nearest below the one you asked for. Wrong answer, green checkmark, shipped.

ArgumentRoleFailure mode when wrong
lookup_valueThe key being matchedTrailing spaces and text-stored numbers produce #N/A on data you can see
table_arrayRange searched in its first columnUnanchored ranges stretch when filled down; whole-column refs slow recalc
col_index_numWhich column to return, counting from the keyOff-by-one grabs the neighboring column; insertions shift it silently
range_lookupFALSE exact / TRUE banded approximateOmitted → TRUE on unsorted data → plausible wrong answers, no error
The four slots of VLOOKUP and where each one bites.

Two behaviors complete the picture. Text matching is case-insensitive, like the = operator, and in exact mode the lookup value can carry wildcards — "SKU-*" matches the first SKU-prefixed entry. And VLOOKUP returns the first match it encounters, top to bottom, which makes it the wrong tool for "the most recent record per customer" without a sort or a timestamp trick — a limitation the XLOOKUP comparison below addresses directly, since search-from-last is a one-argument setting there.

Two lookups, both directions of the match mode

The two match modes exist for genuinely different jobs, and both examples below use data small enough to verify by hand. First, exact match — the classic SKU price fill, where close enough is wrong. Second, approximate match against a sorted tier table, where banded lookup is the feature, not the trap.

Sheet "Prices", range A2:C4:

   A        B             C
1  SKU       Product       Price
2  SKU-041   Brass fitting  8.40
3  SKU-117   Valve seat    21.75
4  SKU-233   Gasket kit    14.20

Sheet "Orders", column A holds SKUs to price.
Worked example — exact match, cross-sheet

Input

Lookup value: A2 (holding SKU-233)
Table: Prices!$A$2:$C$4
Return column: C (Price)
Match mode: exact

Output

=VLOOKUP(A2, Prices!$A$2:$C$4, 3, FALSE)

Returns 14.20.

Recap: finds the value of A2 in the first column of Prices!A2:C4 and returns column C — confirmed as column 3, with the key column counting as 1. The $ anchors keep the range intact when filled down 400 rows; the FALSE keeps a missing SKU as a visible #N/A instead of a neighboring price.
Worked example — banded approximate on a commission table

Input

Tier table A2:B5, first column sorted ascending:

   A                B
1  Monthly floor    Rate
2  0                0.03
3  5000             0.05
4  15000            0.08
5  30000            0.12

Lookup values: 12400, 15000, 4999.99, 31000

Output

=VLOOKUP(D2, $A$2:$B$5, 2, TRUE)

12400  → 0.05   (clears the 5000 floor, not the 15000 floor)
15000  → 0.08   (exactly on a floor returns that band — the boundary rule)
4999.99→ 0.03   (a cent short of the floor stays in the lower band)
31000  → 0.12

And 0.50 → #N/A: below the first row's value, approximate match has nothing at-or-below to return, so it errors instead of guessing.

The banded example repays study, because it's the one place approximate match is not a trap but the feature itself — and its rules are precise. Equal-to-a-floor lands in that band. Below every floor is an error. And the whole mechanism assumes ascending order in the first column: one out-of-order row and the results above it become fiction. This is the same logic that powers tax-bracket tables and shipping-weight charts, and it is the reason the tier table, not the nested IF, is how experienced spreadsheet builders encode any thresholds that a business owner might change. The IF Formula Builder covers the branching alternative when the rule is too irregular for bands.

Failure modes worth memorizing

  • #N/A on visible data. Trailing spaces (invisible in cells, visible in the formula bar), text-stored numbers on either side, and nonbreaking spaces pasted from web pages — the three horsemen. TRIM and CLEAN on the key column fix the first and third; multiply-by-1 paste special or VALUE() fixes the second.
  • The silent column shift. Insert a column inside the table and col_index_num still points at position 3, which is now a different column. The formula recalculates cleanly and returns the wrong field. If your workbook screams at inserters, this is why.
  • The unanchored fill-down. =VLOOKUP(A2, B2:C400, 2, FALSE) filled down shifts to B3:C401, B4:C402... and rows near the bottom start matching against a table that no longer contains their keys. $B$2:$C$400 — or the generator's anchor checkbox — is the fix.
  • #REF! after deleting a column. The table shrinks below the index you asked for, and VLOOKUP says so the only way it can. Recover with undo; the formula won't self-heal.
  • Duplicate keys return the first match. For a price list that's fine; for a transaction log where a customer appears repeatedly, it's wrong by design — the lookup needs a compound key (a helper column concatenating customer and date) or a different tool entirely.
  • Case-sensitivity illusions. Because matching ignores case, ab-1 and AB-1 are the same key to VLOOKUP. If they're distinct products in your catalog, exact mode still won't separate them — build a key column through EXACT-compatible means instead of relying on the lookup.
  • Approximate mode's sorting assumption. It's not "close is fine" — it's "largest value at or below, assuming ascending order." On unsorted data the behavior isn't random but is effectively unpredictable to a reader, which is worse. Exact mode or a properly sorted tier table; nothing in between.
  • Whole-column ranges on huge sheets. VLOOKUP over A:B on a million-row sheet is optimized to the used range but still slower than a bounded range, and a workbook with thousands of such lookups recalculates at a pace people notice. Bound your ranges; your users' patience is a shared resource.

VLOOKUP versus XLOOKUP versus INDEX/MATCH

The successor conversation is worth having precisely because the tradeoffs are real and version availability still decides plenty of shops. Build new lookups with XLOOKUP when every consumer is on Excel 2021 or Microsoft 365; stay with VLOOKUP when the file travels, because a NAME error in a recipient's Excel is a worse failure than any VLOOKUP quirk.

VLOOKUPINDEX/MATCHXLOOKUP
Available sinceEvery Excel version, and SheetsEvery Excel versionExcel 2021/365; Sheets since 2022
Default matchApproximate — the famous trapWhatever MATCH's third arg says (0 = exact)Exact by default
Search directionRightward onlyAny directionAny direction
Insert-column resilienceBreaks silently (static index)Breaks visibly or not at all (column refs)Unaffected (separate return range)
Built-in not-found textNo — wrap in IFNANoYes — fourth argument
Search from lastNoPossible with MATCH type -1Yes — search_mode -1
Readability to newcomersFamiliar but index-counting is opaqueTwo functions, clear to the initiatedOne function, plainest arguments
The three lookup approaches compared on what actually matters in production workbooks.

Our recommendation, stated plainly: build new lookups with XLOOKUP if every consumer of the workbook is on Excel 2021, Microsoft 365, or current Google Sheets. Stay with VLOOKUP when the file travels — to a client on Excel 2016, a plant machine on 2013, a regulator who opens anything — because #NAME? in a recipient's Excel is a worse failure than any VLOOKUP quirk. INDEX/MATCH remains the correct answer in workbooks that already speak it and in the leftward-lookup cases on old versions. The generator emits VLOOKUP and shows the XLOOKUP twin, which is exactly how migrations should happen: side by side, workbook by workbook, never in one heroic Friday-night rewrite.

Copy, paste, close the tab

The generator never opens a workbook, so there is nothing to upload and nothing to leak. The fields hold references and literals you type — A2, Prices!$A$2:$C$4, SKU-233 — and the formula is assembled locally in your browser. It asks for the shape of your data, not the data, and the shape was never secret.

That design is deliberate for lookup work specifically. The values people look up — salaries keyed by employee ID, account balances by account number, prices by confidential SKU — describe the business's nervous system. A generator that required handing over the table to explain a formula would be a bad trade. This one asks for the shape of your data, not the data, and the shape was never secret to begin with.

Frequently asked questions

Why does my VLOOKUP return #N/A when I can see the value in the table?

Ninety percent of the time it's one of three things: the lookup value has a trailing space the table version doesn't (or vice versa), one side is a number stored as text while the other is a real number, or you're in approximate mode on unsorted data. Trim, align types, and force exact match with FALSE — in that order. The generator's recap line catches reversed ranges and wrong column indexes, which cover most of the remaining ten percent.

What does the fourth argument actually do, and what happens if I leave it off?

It selects match mode: FALSE (or 0) demands an exact match; TRUE (or 1) accepts the closest value at or below the lookup, which requires the first column sorted ascending. Leave it off and Excel assumes TRUE — the default that has quietly produced wrong answers since the early 1990s. For ID, SKU, and name lookups, always write the FALSE. The generator never omits it and shows both forms so the difference stays visible.

How do I count the column index number?

Start at the lookup column and count right, with the lookup column itself as column 1. If SKU is column A and price is column C, price is column 3 — not 2, which is the count starting after the key. That off-by-one is the single most common VLOOKUP mistake after the match-mode default, and it's why the generator labels the index with the column letter it lands on.

Can VLOOKUP look to the left of the key column?

No. VLOOKUP only searches the first column of the range and only returns values to the right of it. Leftward retrieval requires INDEX with MATCH — =INDEX(A:A, MATCH(F2, B:B, 0)) — or XLOOKUP, which has no direction restriction. Rearranging the table or adding a helper copy of the key column on the left are the classic workarounds when the layout can't change.

Why does my VLOOKUP break when someone inserts a column?

The column index is a literal number, so inserting a column inside the table shifts the return column one position right while the formula still asks for position 3. Result: no error, just data from the wrong column. Anchoring the range with dollar signs prevents the range from stretching, but nothing built into VLOOKUP protects the index. XLOOKUP's separate return-range argument is the structural fix.

How do I show a blank or custom message instead of #N/A?

Wrap the lookup in IFNA: =IFNA(VLOOKUP(A2, D:E, 2, FALSE), "not found"). IFNA catches only the not-found error, unlike IFERROR which also hides #REF! and #VALUE! — errors you usually want to see. Use IFNA, not IFERROR, for lookup fallbacks.

Does VLOOKUP work the same in Google Sheets?

Yes — same name, same four arguments, same match-mode semantics, and the same approximate-by-default behavior if you omit the fourth argument. Formulas generated here paste directly into Sheets. Sheets additionally offers its own XLOOKUP since 2022 and always had ARRAYFORMULA for filling a column from one formula.

Is the generator free, and does it see my table or data?

Free, and it sees only what you type into its fields — references like D:E or a sample lookup value, never the workbook. Everything runs as client-side JavaScript in this tab: no upload, no account, no stored formulas. Close the page and it's gone.

Sources and further reading

Sources and further reading

We cite primary sources (standards bodies, government agencies, official documentation) wherever they exist so you can verify every number on this page yourself.