# INDEX formula generator

> Describe what you need and get a INDEX formula for Excel and Google Sheets, run on real data before you copy it. Plus 8 tested INDEX examples.

Source: https://spreadsheetpractice.com/tools/formula-generator/index · Updated October 29, 2026 · Formulas and results on this page were run by the Spreadsheet Practice formula engine on November 20, 2026

INDEX returns the value at a given row and column of a range: INDEX(A2:C10,4,2) is the fourth row, second column.

Describe the task at [INDEX formula generator](https://spreadsheetpractice.com/tools/formula-generator/index) and get a INDEX formula for Excel and Google Sheets, tested on real data.

## Tested INDEX examples

### Why does INDEX MATCH return the wrong value or #N/A

`=INDEX(C2:C8,MATCH(F1,A2:A8,0))`

Excel. Result on the sample sheet: 2231. [See it and try it](https://spreadsheetpractice.com/formulas/index-match-returns-wrong-value)

### Return the cell below a matching value

`=INDEX(A2:A11,MATCH(D1,A2:A11,0)+1)`

Excel. Result on the sample sheet: 1250. [See it and try it](https://spreadsheetpractice.com/formulas/value-below-a-match)

### Return a value by its position number with CHOOSE

`=CHOOSE(B2,"Very poor","Poor","Neutral","Good","Excellent")`

Excel. Result on the sample sheet: 6 rows (C2:C7). [See it and try it](https://spreadsheetpractice.com/formulas/choose-value-by-position-number)

### Use INDEX to return a value by row and column number

`=INDEX(B2:F6,I1,K1)`

Excel. Result on the sample sheet: Eli. [See it and try it](https://spreadsheetpractice.com/formulas/index-by-row-and-column-number)

### Fix the #VALUE! error in XLOOKUP

`=XLOOKUP(G1,A2:A9,C2:C9)`

Excel. Result on the sample sheet: $129.00. [See it and try it](https://spreadsheetpractice.com/formulas/xlookup-value-error)

### Why does VLOOKUP return the wrong value

`=VLOOKUP(F1,A2:C9,3,FALSE)`

Excel. Result on the sample sheet: $449.00. [See it and try it](https://spreadsheetpractice.com/formulas/vlookup-returns-wrong-value)

### Calculate percent change from the first to the last value

`=XLOOKUP(TRUE,B2:B13<>"",B2:B13,,0,-1)/B2-1`

Excel. Result on the sample sheet: 23.0%. [See it and try it](https://spreadsheetpractice.com/formulas/percent-change-first-to-last-value)

### Calculate the payback period

`=LET(n,COUNTIF(C2:C7,"<0"),n-1-INDEX(C2:C7,n)/INDEX(B2:B7,n+1))`

Excel. Result on the sample sheet: 3.31. [See it and try it](https://spreadsheetpractice.com/formulas/calculate-the-payback-period)

## Questions

### What does the INDEX formula generator do?

You describe the task in plain English, and it writes the formula, using INDEX where that's the right tool, for your table or a sample one. The formula is run in our engine in Excel and Google Sheets mode before you see it, so you get its result, not just a guess.

### What does INDEX do?

INDEX returns the value at a given row and column of a range: INDEX(A2:C10,4,2) is the fourth row, second column.

### Can I learn to write INDEX formulas myself?

Yes. Each example below opens a page where you try the formula in a live grid and it's checked as you go, and the INDEX function page has a practice exercise.

---

Spreadsheet Practice (https://spreadsheetpractice.com) teaches spreadsheet formulas by practice: every exercise is graded in a live grid and re-checked on changed data.
