Professional Documents
Culture Documents
GUIDE TO USING
EXCEL INDEX
FUNCTION
TrumpExcel.com)
Table of Contents
What it Returns
It returns the value from a table for the specified row number
and column number.
Syntax
=INDEX (array, row_num, [col_num])
=INDEX (array, row_num, [col_num], [area_num])
=INDEX($B$3:$E$10,3,2)
Here is the formula that will make the lookup values dynamic:
=INDEX($B$3:$E$10,MATCH($G$5,$A$3:$A$10,0),MATCH(
$H$4,$B$2:$E$2,0))
=INDEX($B$3:$E$10,MATCH($G$5,$A$3:$A$10,0),0)
If you select the formula in the edit mode and press F9, youll
be able to see the array it returns (as shown below):
Similarly, based on what the lookup value is, when the column
number is specified as 0 (or is left blank), it returns all the
values in the row for the lookup value
=SUM(INDEX($B$3:$E$10,MATCH($G$5,$A$3:$A$10,0),0)
,1)
On similar lines, to calculate the highest score, we can use
MAX/LARGE and to calculate minimum, we can use
MIN/SMALL.
INDEX FUNCTION:
Example 4
Three Way Lookup Using INDEX MATCH
In the above examples, weve used one table with scores for
students in different subjects. This is an example of a two-way
lookup as we use two variables to fetch the score (students
name and the subject).
=INDEX(($B$3:$E$7,$B$11:$E$15,$B$19:$E$23),MATCH(
$G$4,$A$3:$A$7,0),MATCH($H$3,$B$2:$E$2,0),IF($H$2
="Unit Test",1,IF($H$2="Midterm",2,3)))
Let' understand this formula one part at a time.
So far in all the example above, we have used the first syntax,
but to do a three-way lookup, we need to use the second
syntax.
Now lets see each part of the formula based on the second
syntax.
array ($B$3:$E$7,$B$11:$E$15,$B$19:$E$23): Instead of
using a single array, in this case, we have used three arrays
within parenthesis.
row_num MATCH($G$4,$A$3:$A$7,0): MATCH function is
used to find the position of the students name in cell $G$4
in the list of students name.
col_num MATCH($H$3,$B$2:$E$2,0): MATCH function is
used to find the position of the subject name in cell $H$3 in
the list of subjects name.
[area_num] IF($H$2=Unit
Test,1,IF($H$2=Midterm,2,3)): The area number value
tells the INDEX function which array to select. In this
example, we have three arrays in the first argument. If you
select Unit Test from the drop-down, the IF function returns
1 and the INDEX functions select 1st array from the three
arrays (which is $B$3:$E$7).
INDEX FUNCTION:
Example 5
Creating a Reference Using the INDEX Function
Now I can use a simple INDEX function to get the last name
on the list. Here is the formula:
=INDEX($A$2:$A$9,COUNTA($A$2:$A$9))
This function simply counts the number of cells that are not
empty and returns the last item from this list (it works only
when there are no blanks in the list).
=A2:INDEX($A$2:$A$9,COUNTA($A$2:$A$9))
Here are some Excel Resources that will skyrocket your Excel
learning and save a lot of time.
Excel Functions (Examples + Videos)
FREE Excel Templates
Excel Keyboard Shortcuts
Excel Charting Tips
Excel Dashboards Nuts & Bolts
Online Excel Dashboard Course