Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 44
Default Vlookup in vlookup - taking the result as array name

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,
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,081
Default Vlookup in vlookup - taking the result as array name

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

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

"SupperDuck" wrote:

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,

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 44
Default Vlookup in vlookup - taking the result as array name

Wonderful! That was what i need..

Thanks,

Regards,

"SupperDuck" wrote:

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,

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
vlookup shows result one cell above the expected result Marie Excel Worksheet Functions 7 November 14th 06 03:52 AM
Vlookup only taking first line of data Michael Dinning Excel Discussion (Misc queries) 6 June 23rd 06 01:12 PM
Vlookup only taking first line of data mickyd67 Excel Discussion (Misc queries) 0 June 23rd 06 09:15 AM
vlookup based on random result returns incorrect result rickat Excel Worksheet Functions 1 December 6th 05 02:16 PM
Vlookup: Have problem. Not taking the object that i search... SupperDuck Excel Discussion (Misc queries) 1 November 15th 05 11:02 PM


All times are GMT +1. The time now is 02:49 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"