VLOOKUP Column Index Number Explained
By ExcelReady TeamUpdated 7 min read
The short answer
The column index number is VLOOKUP's third argument. It tells Excel which column of the table to return, counted from the left edge of the table you selected, not from column A. In =VLOOKUP(F2,A2:D6,4,FALSE), 4 means the fourth column of A2:D6, which is column D. A number too big gives #REF!.
Key takeaways
- Count the column index number from the first column of your table_array, which is always column 1.
- If the table starts in column B, then column B is 1, C is 2 and D is 3.
- A number below 1 gives #VALUE!; a number larger than the table's width gives #REF!.
- A typed number doesn't change when you insert a column, so use MATCH or COLUMN to keep it correct.
On this page+
- What is the VLOOKUP column index number?
- How to count the column index number
- The table doesn't have to start in column A
- Why does VLOOKUP return #REF! or #VALUE!?
- Why a typed column number breaks when you insert a column
- How to make the column index number dynamic with MATCH
- How to use COLUMN when you copy a VLOOKUP to the right
- Practise it
The VLOOKUP column index number is the third argument in the formula, and it tells Excel which column to bring back once it finds your value. You count it from the left edge of the table you selected, starting at 1, not from column A of the sheet. This guide shows how to count it, what the #REF! and #VALUE! errors mean, and how to make the number update by itself.
What is the VLOOKUP column index number?#
The column index number (Microsoft calls it col_index_num) is a whole number that picks a column inside your table. VLOOKUP has four arguments:
=VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])| Argument | What it means |
|---|---|
| lookup_value | What you are looking for, such as a product ID |
| table_array | The table to search; the first column must hold the lookup values |
| col_index_num | Which column of the table to return: 1 is the first column, 2 the second, and so on |
| range_lookup | FALSE for an exact match, TRUE or blank for an approximate match |
VLOOKUP always searches the first column of the table and then moves right by the number of columns you give. If you are new to the function, start with the step-by-step VLOOKUP guide for beginners.
All the examples below use this product table in A1:D6:
| A | B | C | D | |
|---|---|---|---|---|
| 1 | ID | Product | Category | Price |
| 2 | P-101 | Desk Lamp | Lighting | 24 |
| 3 | P-102 | Office Chair | Furniture | 149 |
| 4 | P-103 | Monitor Stand | Furniture | 39 |
| 5 | P-104 | USB Hub | Electronics | 18 |
| 6 | P-105 | Webcam | Electronics | 55 |
How to count the column index number#
Put your finger on the first column of the table and call it 1, then count right until you reach the column you want. With the table A2:D6, ID is 1, Product is 2, Category is 3 and Price is 4.
| Formula | Column returned | Result |
|---|---|---|
=VLOOKUP("P-103",A2:D6,1,FALSE) | A (ID) | P-103 |
=VLOOKUP("P-103",A2:D6,2,FALSE) | B (Product) | Monitor Stand |
=VLOOKUP("P-103",A2:D6,3,FALSE) | C (Category) | Furniture |
=VLOOKUP("P-103",A2:D6,4,FALSE) | D (Price) | 39 |
A column index number of 1 just returns the value you looked up. That is only useful as a quick check that the value exists.
The FALSE at the end matters as much as the number. Without it, VLOOKUP uses an approximate match and can return the wrong row. The guide to VLOOKUP exact match and why FALSE matters explains this.
The table doesn't have to start in column A#
The count always starts at the first column of table_array, wherever that is. This is the most common source of wrong answers. Say you look up a product name instead of an ID, so the table starts in column B:
=VLOOKUP("Monitor Stand",B2:D6,3,FALSE)Here column B is 1, C is 2 and D is 3, so the result is 39, the price. If you counted from column A out of habit and typed 4, you would get #REF!, because B2:D6 is only three columns wide.
A quick way to check: select the table range in the formula bar and look at the tooltip, or count the letters. B to D is three letters, so the largest valid number is 3.
Why does VLOOKUP return #REF! or #VALUE!?#
The column index number must be at least 1 and no bigger than the number of columns in the table. Outside that range, VLOOKUP returns an error:
| Column index number | Table | Result | Why |
|---|---|---|---|
| 0 or a negative number | A2:D6 | #VALUE! | There is no column 0; VLOOKUP can't look left |
| 5 | A2:D6 | #REF! | The table has only 4 columns |
| 2.7 | A2:D6 | Monitor Stand (for P-103) | Excel drops the decimal and uses 2 |
The negative number case is worth remembering. VLOOKUP can only return columns to the right of the lookup column. To return a column on the left, use XLOOKUP or INDEX MATCH. The comparison of VLOOKUP vs INDEX MATCH shows both on the same data. For other errors, see why VLOOKUP is not working and how to fix it.
Why a typed column number breaks when you insert a column#
A typed number such as 4 never changes, even when the table does. Suppose you insert a new column, Supplier, between Category and Price. Excel stretches the table reference from A2:D6 to A2:E6, but the 4 stays a 4. Column 4 is now Supplier, so your price formula quietly returns supplier names.
There is no error message, which makes this mistake easy to miss. Two fixes keep the number correct:
- Look up the header with MATCH, so the number follows the column.
- Use XLOOKUP or INDEX MATCH, which point at the return column directly instead of counting.
How to make the column index number dynamic with MATCH#
MATCH finds the position of a header in the header row, and that position is exactly the column index number you need. In the product table:
=VLOOKUP("P-103",A1:D6,MATCH("Price",A1:D1,0),FALSE)MATCH("Price",A1:D1,0) returns 4, because Price is the fourth header. VLOOKUP then returns 39. If someone inserts a column before Price, MATCH returns 5 and the formula still finds the price.
Make sure the header row in MATCH starts in the same column as the table. If the table starts in column A, the header range must start in column A too, or the count will be off by one.
You can also put the header name in a cell, such as H1, and write MATCH(H1,A1:D1,0). Now you can change H1 from Price to Category and the same formula returns a different column.
How to use COLUMN when you copy a VLOOKUP to the right#
When you need several columns for the same ID, COLUMN can supply the number for you. COLUMN(B1) returns 2, because B is the second column of the sheet. Copy it one cell to the right and it becomes COLUMN(C1), which returns 3.
=VLOOKUP($F2,$A$2:$D$6,COLUMN(B1),FALSE)Type this in one cell, select it with the two cells to its right, and fill right (Windows: Ctrl+R; Mac: ⌘R). The first cell returns the product name, the next the category and the third the price. The $ signs keep the lookup cell and the table fixed while the column number grows. This trick only works when the table starts in column A, because COLUMN counts from column A of the sheet. The guide to returning several columns with one VLOOKUP covers this and other methods. For a quick syntax reference, see the VLOOKUP function guide.
Practise it#
Counting columns is easy to read about and easy to get wrong under time pressure in a job test. Practise VLOOKUP in a live spreadsheet: you type the formula, and it checks the column index number and the result instantly. Then work through more VLOOKUP practice tasks with tables that don't start in column A.
Try it yourself
This is a live spreadsheet. Type the formula in the green cell and press Enter.
What is the price of product P-104? Click G2 and write a VLOOKUP that finds F2 in A2:D6 and returns the 4th column, with FALSE for an exact match.
| A | B | C | D | E | F | G | H | |
|---|---|---|---|---|---|---|---|---|
| 1 | Price | Price | ||||||
| 2 | P-104 | |||||||
| 3 | ||||||||
| 4 | ||||||||
| 5 | ||||||||
| 6 | ||||||||
| 7 | ||||||||
| 8 | ||||||||
| 9 |
Tip: Count the columns of A2:D6 from the left: ID is 1, Product is 2, Category is 3, Price is 4.
Practise this in a lesson
Frequently asked questions
What is the column index number in VLOOKUP?
It is the third argument of VLOOKUP. It tells Excel which column of the selected table to bring back, counting the first column of the table as 1.
Do I count the column index number from column A?
No. You count from the first column of the range you selected. If your table is C2:F20, then column C is 1, D is 2, E is 3 and F is 4.
Why does VLOOKUP give #REF! with my column index number?
The number is bigger than the number of columns in your table. A table of A2:C10 has three columns, so a column index number of 4 returns #REF!. Make the table wider or use a smaller number.
Can the column index number come from a formula?
Yes. You can use MATCH to find a header's position, like MATCH("Price",A1:D1,0), or COLUMN to get a number that grows as you copy the formula to the right.
Can VLOOKUP use a negative column index number to look left?
No. A number below 1 returns #VALUE!. VLOOKUP can only return columns to the right of the lookup column. Use XLOOKUP or INDEX MATCH to look left.