Skip to content

VLOOKUP Column Index Number

Premiumintermediate 15 min4 tasks0/54 pts

The column index in VLOOKUP counts columns from the left edge of the table you give it, not from column A of the sheet. Change the number and the same lookup returns a different column. Lookup values can be numbers (like IDs) as well as text.

Syntax

VLOOKUP(lookup_value, table_array, col_index_num, FALSE)

Example: =VLOOKUP(104,A2:D7,4,FALSE) finds ID 104 in column A and returns the 4th column of A2:D7 (the salary).

Common mistakes

  • Counting the column number from the sheet instead of from the table.
  • A column index larger than the table width gives #REF!.

When to use VLOOKUP

This lesson is about the third argument of VLOOKUP, col_index_num. It is the part people most often get wrong. The number tells VLOOKUP which column of your table to return, counting the table's first column as 1. It has nothing to do with the sheet's column letters.

You need this whenever your table does not start in column A. With a table in D2:H50, column D is 1, E is 2, and so on. If you count from A you will get the wrong field or a #REF! error.

The same rules apply to numeric keys. Employee IDs, order numbers and SKUs are often numbers, and VLOOKUP finds them just as it finds text, as long as both sides really are numbers.

Worked example: Return different fields for the same employee

Staff data is in A1:D7 (ID, Name, Dept, Salary). Cell F2 holds the ID 104.

IDNameDeptSalary
101AnaSales42,000
103CaraIT55,000
104DevSales47,000

Formula

=VLOOKUP(F2,A2:D7,4,FALSE)

  1. Count the columns inside A2:D7: ID = 1, Name = 2, Dept = 3, Salary = 4.
  2. Use 4 to return Salary: the result is 47000.
  3. Change only the number to 3 and the same formula returns the department, Sales.
  4. A number such as 104 can also go straight into the formula without quotes: =VLOOKUP(104,A2:D7,2,FALSE) returns Dev.

Result: One lookup pattern returns any column. Only the column index changes.

Common errors and how to fix them

  • #REF!

    col_index_num is larger than the table is wide. With A2:D7 the highest valid number is 4.

  • #VALUE!

    col_index_num is less than 1. Column numbers start at 1.

  • Returns the wrong field after someone inserted a column

    A typed number does not move when columns move. Use MATCH on the header row to work out the column number, or switch to XLOOKUP.

  • #N/A on numeric IDs

    One list holds the IDs as text. Convert them with VALUE or Text to Columns, or look up F2&"" against a text column.

Frequently asked questions

Does the column index count from column A?

No. It counts from the first column of table_array. If the table starts in column C, then C is column 1.

Can I make the column number update automatically?

Yes. Replace the number with MATCH, for example =VLOOKUP(F2,A2:D7,MATCH("Salary",A1:D1,0),FALSE). It finds the right column even after columns are moved.

Do numbers need quotes in VLOOKUP?

No. Put text in quotes ("Ana") and type numbers as they are (104).

Related lessons

Function reference: VLOOKUP

Read the lesson, then try it yourself in a live spreadsheet.