Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Excel Formula

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

CHEAT SHEET: MATCH & INDEX

MATCH
MATCH finds a match on a given input value within a one-dimensional cell range (one column or one row)
and tells you the position.

For example, if you search for QLD in this range of cells, the position is 2.

To get that result using a MATCH function:

=MATCH(“QLD”, A1:A8, 0)

Or if cell C1 contained the match value (QLD) and the range was named
Aussie_States, the formula is

=MATCH(“C1, Aussie_States, 0)

The 3rd parameter can be 0 (for exact match) or 1 or -1 for the closest match
above or below the given value. In most situations (and for every situation where
text is used) use 0 for exact match.

INDEX
INDEX picks out the data from a specified row and column within a specified data range.

For example, the data in row 3 and column 1 of the data section of this table is ‘Daniel Ricciardo’.

To get that result using a INDEX function:

=INDEX(C2:G11, 3, 1)

Or if the data section of the table was named F1_Table the formula is

=INDEX(F1_Table, 3, 1)

Copyright © 2016 Two Rivers Software Training


www.trst.com.au All Rights Reserved
CHEAT SHEET: MATCH & INDEX

Combining MATCH and INDEX


You can combine MATCH and INDEX to make things much more flexible and friendly.

Consider this addition underneath the table:

The 2 orange cells contain the user’s choice of team and specification. You could either type these in directly
or use a tool like Data Validation to produce a drop-down list (this technique is included in the video)

Driver 1 for Red Bull (in 2015) is Daniel Ricciardo.

We can get that result in 3 easy steps.

Step 1
Find the position of ‘Red Bull’ in the cell range B2:B11 (which we will name ‘Teams’ for convenience). Here’s
the formula:

=MATCH(C13, Teams, 0)

Step 2
Find the position of ‘Driver 1’ in the cell range C1:G1 (which we will name ‘Specs’ for convenience). Here’s
the formula:

=MATCH(C14, Specs, 0)

Copyright © 2016 Two Rivers Software Training


www.trst.com.au All Rights Reserved
CHEAT SHEET: MATCH & INDEX
Step 3
Select the data from the table using the result from step 1 for the row number (let’s name that Team_Pos
for convenience) and the result from step 2 for the column number (let’s name that Spec_Pos for
convenience). The data section of the table is named F1_Table. Here’s the formula:

=INDEX(F1_Table, Team_Pos, Spec_Pos)

Putting everything into one super formula


Using this same table:

The formula is:

=INDEX(F1_Table, MATCH(C13, Teams, 0), MATCH(C14, Specs, 0)

Whether you create a super-formula or use 3 separate steps, once completed, the team in cell C13 and the
spec in cell C14 can be changed and the new data from the table.

For example, if the team is McLaren (row 5) and the Spec is Big Chief(s) (column 5), the result is Ron Dennis.

Copyright © 2016 Two Rivers Software Training


www.trst.com.au All Rights Reserved

You might also like