Leading the way in Microsoft Office Development
 Home|Excel|Word|PowerPoint|Consultancy|Feedback|Contact 
 Microsoft Excel > Functions Advanced > VLOOKUP & MATCH - Cross Reference< Previous | Next > 

 

Cross referencing (or two way lookup) in a table

 
 

This assumes you want to cross reference by using a value in the first column and a value in the first row.

 
 

An alternative way to lookup values (i.e. cross reference) in any column (or row) is to combine the VLOOKUP() and MATCH() functions.

 
   
 

The VLOOKUP() function can be used to find the value in a column that matches a value in the first column of a table.

 
 

The MATCH() function can be used to find the position of a value in a particular cell range.

 
 

The following formula will return the cross reference of a particular column heading with a particular row heading.

 
 
=VLOOKUP("col_item",B2:L12,MATCH("row_item",B2:L2,0))
 
 

"col_item" is the heading that you want to find in the list of column headings (C2:L2).

 
 

"row_item" is the heading that you want to find in the list of row headings (B3:B12).

 

 

The following formula will return the cross reference of Bristal across and Aberdeen down.

 
 
=VLOOKUP("Bristol",B2:L12,MATCH("Aberdeen",B2:L2,0)) = 513
 
 

The following formula will return the cross reference of London across and Leeds down.

 
 
=VLOOKUP("London",B2:L12,MATCH("Leeds",B2:L2,0)) = 198
 


 

Cross referencing (or two way lookup) in a table (HLOOKUP and MATCH)

 
 

The HLOOKUP() function can be used to find the value in a row that matches a value in the first row of a table.

 
 

The MATCH() function can be used to find the position of a value in a particular cell range.

 
 

The following formula will return the cross reference of a particular column heading with a particular row heading.

 
 
=HLOOKUP("row_item",B2:L12,MATCH("col_item",B2:B12,0))
 
 

"col_item" is the heading that you want to find in the list of column headings (C2:L2).

 
 

"row_item" is the heading that you want to find in the list of row headings (B3:B12).

 
 

Notice that the row identifier is the first argument used.

 

 

The following formula will return the cross reference of Aberdeen across and Bristol down.

 
 
=HLOOKUP("Aberdeen",B2:L12,MATCH("Bristol",B2:B12,0)) = 513
 
 

The following formula will return the cross reference of Leeds across and London down.

 
 
=HLOOKUP("Leeds",B2:L12,MATCH("London",B2:B12,0)) = 198
 


 

Cross referencing (or two way lookup) in a table with duplicates

 
 

Lets assume that you are using the VLOOKUP and MATCH combination to perform your cross reference.

 
 

If you have any duplicates in your column headings the first matching column will be used.

 
 

If you have any duplicates in your row headings the last matching row will be used.

 

 Copyright © 2004-2007 Better Solutions Limited. All Rights Reserved.< Previous | Top | Next >