VLOOKUP and MATCH: How They Work Together

Formulas & functions · Updated November 23, 2026

VLOOKUP and MATCH are two Excel functions that, when combined, let you look up a value in a table by both row and column headings — essentially a two-dimensional lookup. VLOOKUP alone finds a value in the first column and returns a value from a specified column to the right; MATCH alone returns the position of a value in a row or column. Used together, VLOOKUP with MATCH replaces the need to count columns manually and makes your formulas dynamic and easier to maintain.

What Is VLOOKUP?

VLOOKUP stands for “Vertical Lookup.” It searches for a value in the first column of a table and returns a value in the same row from a column you specify. The syntax is:

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

  • lookup_value — the value to search for (e.g., a product ID in cell A2).
  • table_array — the range that contains the data (e.g., A2:F100).
  • col_index_num — the column number in the table from which to return a value (1 for first column, 2 for second, etc.).
  • range_lookup — TRUE for approximate match (default), FALSE for exact match. For most lookups, use FALSE.

VLOOKUP only looks to the right. It cannot return values from columns to the left of the lookup column. Also, if your table has duplicate lookup values, VLOOKUP returns the first match.

What Is MATCH?

MATCH returns the relative position of a value in a range. The syntax is:

=MATCH(lookup_value, lookup_array, [match_type])

  • lookup_value — the value to find (e.g., “Price” in a header row).
  • lookup_array — the range to search (e.g., A1:F1).
  • match_type — 0 for exact match, 1 for less than (requires sorted ascending), -1 for greater than (requires sorted descending). Use 0 for exact matches.

MATCH is not case-sensitive and works with text, numbers, or errors. It returns a number, not the value itself. For example, =MATCH("Price", A1:F1, 0) returns 4 if “Price” is in D1.

Why Combine VLOOKUP and MATCH?

The main reason is to avoid hard-coding the column index number. If you write =VLOOKUP("P123", A2:F100, 4, FALSE), and later insert a column before column D, the 4 becomes wrong — it now points to a different column. Using MATCH for the column index makes the formula self-adjusting:

=VLOOKUP("P123", A2:F100, MATCH("Price", A1:F1, 0), FALSE)

Now if you insert a column, the MATCH recalculates the correct column number. This is especially useful in dashboards or reports where the data layout changes frequently.

Step-by-Step Example

Assume you have a product table in cells A1:F10. Row 1 contains headers: Product ID, Product Name, Category, Price, Stock, Supplier. You want to find the Price for product “P123”.

  1. In cell H1, type the product ID: P123.
  2. In cell H2, enter the formula: =VLOOKUP(H1, A1:F10, MATCH("Price", A1:F1, 0), FALSE)
  3. Press Enter. The result is the price from the Price column for that product.

If you change the header in row 1 from “Price” to “Sale Price”, the formula will return #N/A until you update the MATCH text. To avoid that, you could use a cell reference for the header name, e.g., MATCH(H3, A1:F1, 0) where H3 contains “Price”.

Common Problems and Solutions

  • #N/A error: The lookup value is not found, or the column header text does not exactly match (watch for extra spaces). Use TRIM or EXACT to diagnose.
  • #VALUE! error: The col_index_num is less than 1 or greater than the number of columns in table_array. Check the MATCH result.
  • Wrong results with approximate match: If you omit the last argument or use TRUE, VLOOKUP assumes the first column is sorted and may return an incorrect match. Always use FALSE for exact matches unless you intend an approximate match.
  • Inserting columns breaks the formula: Using MATCH solves this, but if you insert a row at the top, the header row reference (A1:F1) may shift. Use absolute references like $A$1:$F$1 if needed.

VLOOKUP vs. INDEX/MATCH vs. XLOOKUP

Many users switch to INDEX/MATCH because it can look left and is more flexible. The syntax is =INDEX(return_range, MATCH(lookup_value, lookup_range, 0)). For example, to return the product name (column B) based on product ID in column A: =INDEX(B2:B10, MATCH("P123", A2:A10, 0)). This is often preferred because it does not require the lookup column to be the first column of the table.

XLOOKUP, available in Excel 2021 and Microsoft 365, is the modern replacement. It can look left or right, return multiple values, and has built-in error handling. Example: =XLOOKUP("P123", A2:A10, B2:B10) returns the product name. For a two-way lookup, you can nest XLOOKUP: =XLOOKUP("P123", A2:A10, XLOOKUP("Price", B1:F1, B2:F10)).

If you are using an older Excel version (2016 or earlier), INDEX/MATCH is the safest alternative to VLOOKUP+MATCH. If you have Microsoft 365, consider XLOOKUP for simplicity.

Frequently Asked Questions

Can I use VLOOKUP and MATCH together to look up both row and column?

Yes. The combination =VLOOKUP(lookup_value, table, MATCH(column_header, header_row, 0), FALSE) effectively does a two-dimensional lookup. The MATCH finds the column number, and VLOOKUP finds the row. This is a common technique before XLOOKUP existed.

Why does my VLOOKUP return #N/A even though the value exists?

Common causes: the lookup value is text but the table contains numbers (or vice versa), there are leading/trailing spaces, or the lookup column is not the first column in the table_array. Also, if you use TRUE for approximate match, the first column must be sorted ascending; otherwise, you may get wrong results or #N/A.

Is MATCH case-sensitive?

No, MATCH is not case-sensitive by default. If you need a case-sensitive match, use EXACT in an array formula or combine with INDEX and MATCH using EXACT in older Excel, but this is complex. In Microsoft 365, you can use XLOOKUP with the match_mode argument set to 2 for case-sensitive.

What is the difference between MATCH and INDEX?

MATCH returns a position number. INDEX returns the value at a given row and column position. They are often used together: INDEX gives you the value, MATCH finds the position. VLOOKUP is a single function that does both, but only for vertical lookups to the right.

Can I use VLOOKUP with MATCH to return multiple columns?

VLOOKUP returns only one value per formula. To return multiple columns, you can copy the formula across and change the column header in MATCH, or use an array formula with INDEX and MATCH. In Microsoft 365, you can use XLOOKUP with a return array to get multiple columns at once.

Does VLOOKUP work with wildcards?

Yes, VLOOKUP supports wildcards when using exact match (FALSE): asterisk (*) for any sequence, question mark (?) for a single character. For example, =VLOOKUP("P*", A2:B10, 2, FALSE) returns the first product starting with P. MATCH also supports wildcards in the same way.

Related

Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.

More in Formulas & functions

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.