Cellgrids Cellgrids
Home › Practice questions › INDEX › Question 7

Excel INDEX Practice Question: Using INDEX with ROWS, return the second-last name in the list and put it in D2.

By Rinkesh Shah, founder of Cellgrids.

The question

Using INDEX with ROWS, return the second-last name in the list and put it in D2.

The data

ABCD
1Name2nd last
2Asha?
3Ben
4Chitra
5Dev
6Esha
7Farah
8Gita

The yellow cell is where your answer goes.

Show answer

Answer in D2: Farah

How it works

Explanation: ROWS counts the cells in the range. Subtracting 1 from that count points at the position just before the last one.
Syntax: =INDEX(A2:A8,ROWS(A2:A8)-1)
There are 7 names, so the position is 7 - 1 = 6. The sixth name is Farah.

Try it yourself in the live sheet

Type your formula in the highlighted cell and get instant feedback. Free, no Excel install needed.

Try this question in the live sheet →

INDEX syntax

=INDEX(array, row_num, [column_num])

Returns the value at a given row/column position within a range. Pulling the Nth item from a list — often paired with MATCH to look up in any direction. Full INDEX guide.

More INDEX practice questions

All practice questions · Excel exercises · Interview prep · Cheat sheet