ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Using function results as parameters in another function (https://www.excelbanter.com/excel-worksheet-functions/23420-using-function-results-parameters-another-function.html)

Steve Haack

Using function results as parameters in another function
 
I am using the VLOOKUP function and it works as described. However, I would
like to use it in the following way:
Let's say that I have some text in A1, and it will change from time to time.
I need to do a VLOOKUP, where the text in A1 will determine the named range
that the VLOOKUP will be perfomed on.

For example, if A1 contains "Steve" then I would like to have the VLOOKUP
performed on a range named "SteveScores", or if A1 contains "Mike", then I
would like to do the lookup on a range named "MikeScores".

I know that I need to CONCATENATE the text in A1 with "Scores" but I cannot
figure out how to get the VLOOKUP function to accept that concatenated text
as the parameter for the named range to do the loopup in.

Is this even possibe?

JE McGimpsey

One way:

=VLOOKUP(B1,INDIRECT(A1 & "Scores"), 2, FALSE)

In article ,
"Steve Haack" <Steve wrote:

I am using the VLOOKUP function and it works as described. However, I would
like to use it in the following way:
Let's say that I have some text in A1, and it will change from time to time.
I need to do a VLOOKUP, where the text in A1 will determine the named range
that the VLOOKUP will be perfomed on.

For example, if A1 contains "Steve" then I would like to have the VLOOKUP
performed on a range named "SteveScores", or if A1 contains "Mike", then I
would like to do the lookup on a range named "MikeScores".

I know that I need to CONCATENATE the text in A1 with "Scores" but I cannot
figure out how to get the VLOOKUP function to accept that concatenated text
as the parameter for the named range to do the loopup in.

Is this even possibe?



All times are GMT +1. The time now is 02:34 AM.

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