Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

INDEX Formula in Excel: Step-by-Step Guide

· 7 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

The INDEX formula returns the value at a specific position inside a range or array. In its simplest form, =INDEX(A1:C10,2,3) gives you the cell in the second row and third column of that range — here, C2. INDEX becomes genuinely useful when you nest MATCH inside it, because that combination looks up a value in one column and returns a matching value from another column in either direction, left or right. You need nothing installed beyond Excel itself; the steps below work in Excel for Microsoft 365, Excel 2021/2019 and Excel for Mac, though button names may differ slightly by version and region.

What You'll Need

  • Microsoft Excel (desktop or web) or Excel for Mac. Google Sheets also supports INDEX identically if you are adapting the steps.
  • A table of data with a header row and no blank rows or columns inside it.
  • A basic understanding of referring to ranges, for example A2:A100.
  • Optional but helpful: converting the range to an Excel Table with Ctrl+T, so formulas extend automatically.

Step-by-Step

  1. Lay out your data cleanly. Put column headers in row 1 and data from row 2 down. Try to avoid merged cells inside the lookup range, because they confuse both INDEX and MATCH.
  2. Start with a plain INDEX. Click an empty cell and type a formula such as =INDEX(A2:C20,4,2). The first argument is the range, the second is the row number counted from the top of that range (not from row 1 of the sheet), and the third is the column number counted from the left. Press Enter. The result is the cell in the fourth row and second column of A2:C20.
  3. Understand what row 1 of the range means. If your range starts at A2, then row 1 of the range is sheet row 2. This is the single most common source of off-by-one errors, so always count from the top of the range you typed.
  4. Add MATCH to find the row number. Type =MATCH("Widget",A2:A20,0) in a spare cell. The zero at the end means exact match. If Widget is the third item in A2:A20, MATCH returns 3, and INDEX with row 3 returns the matching row. Exact match with 0 is almost always what you want; omitting it gives an approximate match that assumes sorted data.
  5. Nest MATCH inside INDEX. Replace the hard-coded row number: =INDEX(B2:B20,MATCH("Widget",A2:A20,0)). This returns the value from B in the same row where A equals Widget. Note that when the range is a single column, INDEX only needs the row argument.
  6. Turn the lookup value into a cell reference. Put the search term in, say, F2 and write =INDEX(B2:B20,MATCH(F2,A2:A20,0)). Now typing a different name in F2 updates the result. This is the version you want to copy down a column.
  7. Return a different column by pointing at it. To pull the price from column D instead, change only the first range: =INDEX(D2:D20,MATCH(F2,A2:A20,0)). Because INDEX is told exactly which column to read, it can return data that sits to the left of the search column — something VLOOKUP cannot do.
  8. Use a two-dimensional lookup when needed. Supply both a row MATCH and a column MATCH: =INDEX(B2:E20,MATCH(F2,A2:A20,0),MATCH("March",B1:E1,0)). The first MATCH finds the row, the second finds the column, and INDEX returns their intersection. This replaces the classic two-way VLOOKUP-plus-HLOOKUP approach.
  9. Handle missing values deliberately. Wrap the formula in IFERROR: =IFERROR(INDEX(B2:B20,MATCH(F2,A2:A20,0)),"Not found"). Without it, a failed exact match shows #N/A, which looks like a broken sheet to anyone reading it.
  10. Lock the ranges before copying. Press F4 to convert A2:A20 to $A$2:$A$20 and B2:B20 to $B$2:$B$20. Fill the formula down and across, then spot-check two or three results by hand against the source data.

Common Mistakes

Counting rows from row 1 instead of from the range start. With a range beginning at A2, the fourth data row is INDEX row 4, not row 3. If every result is shifted by one, this is almost certainly why.

Forgetting the exact-match zero in MATCH. Without the 0, MATCH assumes ascending order and can return the wrong row silently — no error, just a wrong answer.

Using a range that is smaller than the data. INDEX and MATCH only look inside the ranges you give them. If you type A2:A20 but the data runs to row 200, everything past row 20 is invisible.

Trying to return a whole row with plain INDEX. In legacy Excel, leaving the column argument empty or at 0 requires entering the formula with Ctrl+Shift+Enter, or it misbehaves. Use a specific column number instead, or use dynamic-array Excel where it spills naturally.

Trailing spaces and number-vs-text mismatches. "Widget " with a trailing space is not "Widget", and a code stored as text will not match the same code stored as a number. TRIM the source data, or check the type with ISTEXT.

Writing the MATCH range and the INDEX range in the wrong order. The row number from MATCH must refer to the same row layout as the INDEX range, or the two will drift apart.

Tips

  • Use structured references with a Table, for example =INDEX(Table1[Price],MATCH(F2,Table1[Item],0)). Ranges grow with the data and become far easier to read.
  • INDEX/MATCH recalculates faster than a comparable VLOOKUP over large data, because it reads only the one column it needs.
  • To return several adjacent columns at once, keep the MATCH part fixed and let the column number be a small extra lookup against the header row.
  • You can replace the row argument with a comma-skipped empty argument, as in =INDEX(A:A,5), to read the fifth cell of a whole column.
  • Excel's newer XLOOKUP does the same job with less nesting if your version has it. INDEX/MATCH remains the portable choice for shared workbooks opened in older versions.

Troubleshooting

You see #N/A. The lookup value does not exist exactly as typed in the search range. Check for extra spaces, different capitalisation rules, or a number stored as text. Use MATCH alone in a cell to confirm whether it finds the value at all.

You see #REF! The row or column number points outside the range. If a MATCH returned 25 but your INDEX range has 20 rows, you will get #REF!. Make the two ranges the same height.

You see #VALUE!. Usually a non-numeric row or column argument, often a cell holding text. Check that the MATCH result is a number.

The result is right for the first row but wrong below. Ranges were not anchored with dollar signs. Re-enter the formula with F4-locked ranges and fill down again.

Results update when you did not expect them to. Automatic calculation is on and the source data changed. Freeze values with Paste Special > Values if you need a static record.

If that did not work, rebuild the formula in two cells — one holding the MATCH, one holding INDEX that points at that cell. Once both halves behave, combine them. Also verify the cell format: a lookup returning numbers formatted as text can look wrong even when the maths is right.

Frequently Asked Questions

What is the difference between INDEX and MATCH?

MATCH finds the position of a value within a range and returns a number. INDEX takes a range plus a row and column number and returns the value at that spot. Nested together, MATCH supplies the position and INDEX returns the data.

Can INDEX return values to the left of the lookup column?

Yes. That is the main reason people prefer INDEX/MATCH over VLOOKUP, which can only look to the right of the key column.

Does INDEX work without MATCH?

Yes. =INDEX(range,row,column) on its own returns a cell at a fixed position, which is handy for pulling, say, the third value in a list.

Is INDEX/MATCH case-sensitive?

Not by default; MATCH ignores case. If case matters, use an exact comparison formula such as =INDEX(B2:B20,MATCH(TRUE,EXACT(A2:A20,F2),0)), entered as an array or in dynamic-array Excel directly.

Why does my INDEX/MATCH return 0 instead of a blank cell?

INDEX returns the value actually stored in the cell. If the matched cell is empty, you get 0. Wrap the formula in IF to show a blank instead, or check that you are pointing at the correct column.

Should I use XLOOKUP instead?

If your version of Excel has XLOOKUP, it is simpler to write and handles missing values natively. Use INDEX/MATCH when the workbook must open in older Excel versions or when you are sharing it widely.