ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Lookup in Matrix (https://www.excelbanter.com/excel-worksheet-functions/24736-lookup-matrix.html)

Johannes

Lookup in Matrix
 
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?



Leo Heuser

Hello Johannes

One way:

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

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

--
Best Regards
Leo Heuser

Followup to newsgroup only please.

"Johannes" skrev i en meddelelse
...
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?





Andy Wiggins

This file might be a help:
http://www.bygsoftware.com/examples/.../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/fun...sumproduct.htm


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


"Johannes" wrote in message
...
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?





Johannes

Cheers, works perfectly
"Leo Heuser" schreef in bericht
...
Hello Johannes

One way:

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

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

--
Best Regards
Leo Heuser

Followup to newsgroup only please.

"Johannes" skrev i en meddelelse
...
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?







Johannes

Guess the VBA solution is the prettiest. Kind of sad these things are not
standard functions...

Thanks,

Johannes
"Andy Wiggins" o m schreef in bericht
...
This file might be a help:
http://www.bygsoftware.com/examples/.../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/fun...sumproduct.htm


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


"Johannes" wrote in message
...
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?







Leo Heuser

You're welcome and thanks for the feedback :-)

LeoH


"Johannes" skrev i en meddelelse
...
Cheers, works perfectly





All times are GMT +1. The time now is 09:57 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com