Vlookup in vlookup - taking the result as array name

G

Guest

Hello all,

I have an array called "months" and for ex. it has the values;

1 Jan
2 Feb
3 Mar

And i have 12 arrays named: Jan, Feb... And the arrays has values, for ex;

Array Jan:
prt1 2
prt2 3
prt3 5

Array Feb:
prt1 6
prt2 4
prt3 2


I want to do this;

=vlookup("prt1", vlookup(1, months, 2, 0), 2, 0)

So, it will look for prt1 in array Jan and have a result as 2.

As you see, i want to use the result in the second vlookup as the name of
the array for the first vlookup.

I can do this in a macro but i wonder how i can do this in a formula?

Thanks & regards,
 
G

Guest

It looks like you simply need to wrap the inner VLOOKUP with an INDIRECT

=vlookup("prt1",INDIRECT( vlookup(1, months, 2, 0)), 2, 0)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top