Lookup in Matrix

J

Johannes

Hello all,

How can I look up a value in a matrix. First column has countries, first row
has years. Am looking for value of specific country in specific year.
Thought about combinations of lookup and matches, but that does not make it
any prettier. Any suggestions?

Any suggestions?
 
L

Leo Heuser

Hello Johannes

One way:

=INDEX(C2:I9,MATCH("Country",B2:B9,0),MATCH(Year,C1:I1,0))

Data in C2:I9, countries in B2:B9 and years in C1:i1
 
A

Andy Wiggins

This file might be a help:
http://www.bygsoftware.com/examples/zipfiles/xindexvba.zip
It's in the "Excel for Lotus 123 Users" section on page:
http://www.bygsoftware.com/examples/examples.htm

In Excel there is no direct equivalent for Lotus 123's XINDEX function. This
workbook shows two Excel formula constructions that achieve the same result.

The first example uses two additional inputs. It uses the Excel functions:
INDEX and MATCH The second example uses the same inputs as the Lotus XINDEX
function. It uses the Excel functions: INDEX, MATCH and OFFSET.

There are also two additional pieces of VBA showing how to use this in code
and capture an error condition.

The code is open and commented.

There is also an alternative construction using SUMPRODUCT at:
http://www.bygsoftware.com/Excel/functions/sumproduct.htm


--
Regards
-
Andy Wiggins FCCA
www.BygSoftware.com
Excel, Access and VBA Consultancy
 
J

Johannes

Cheers, works perfectly
Leo Heuser said:
Hello Johannes

One way:

=INDEX(C2:I9,MATCH("Country",B2:B9,0),MATCH(Year,C1:I1,0))

Data in C2:I9, countries in B2:B9 and years in C1:i1

--
Best Regards
Leo Heuser

Followup to newsgroup only please.
 
Top