+ Reply to Thread
Results 1 to 6 of 6

How to Assign an array Name to a number value to use in HLOOKUP

  1. #1
    Registered User
    Join Date
    12-12-2012
    Location
    waterloo, canada
    MS-Off Ver
    Excel 2016
    Posts
    19

    How to Assign an array Name to a number value to use in HLOOKUP

    My Values sheet has a column that needs to be populated with values obtained from the Tables sheet (same workbook) that has multiple tables. I named each table as _89MS and _89MNS. My HLOOKUP needs to be able to determine which table (multiple tables in one worksheet) to extract values from. I actually have several tables, but have included 2 for this example. I do other calcs that end with a value that indicates what table to use. It's a static table of values. For instance a value of 339 aligns with table 89MS, and 364 aligns with 89MNS. So if my calculation renders 339, then I need to use table 89MS. My conundrum is how do I assign the value of 339 to the named array of _89MS, and hence use that named array in my HLOOKUP formula.

    I attached a simple Excel as an example. Note, that I am using Excel 2016. Will need to update my profile. Thanks
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: How to Assign an array Name to a number value to use in HLOOKUP

    I re-aranged your 2 tables in to 1 table and add the values together.

    after that an index/match to get the data.

    see the attached file.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,150

    Re: How to Assign an array Name to a number value to use in HLOOKUP

    Or... change your table of static values to reflect the actual names of the tables

    _89MS and not 89MS

    and then use:

    =HLOOKUP($B$2,INDIRECT(VLOOKUP($B$22,$B$16:$C$20,2,FALSE)),A6+1)

    in B6, copied down.
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  4. #4
    Registered User
    Join Date
    12-12-2012
    Location
    waterloo, canada
    MS-Off Ver
    Excel 2016
    Posts
    19
    Quote Originally Posted by oeldere View Post
    I re-aranged your 2 tables in to 1 table and add the values together.

    after that an index/match to get the data.

    see the attached file.
    OELDERE, Thank you very much for the assistance. I used the other respondent's solution which didn't require changes to the tables.
    Gordco

  5. #5
    Registered User
    Join Date
    12-12-2012
    Location
    waterloo, canada
    MS-Off Ver
    Excel 2016
    Posts
    19
    Quote Originally Posted by Glenn Kennedy View Post
    Or... change your table of static values to reflect the actual names of the tables

    _89MS and not 89MS

    and then use:

    =HLOOKUP($B$2,INDIRECT(VLOOKUP($B$22,$B$16:$C$20,2,FALSE)),A6+1)

    in B6, copied down.
    Glenn, your solution worked great. Much appreciated!
    Gordco

  6. #6
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: How to Assign an array Name to a number value to use in HLOOKUP

    You're welcome. We appreciate the feedback!

    If your question has been solved please mark the thread as being solved.

    In the menu bar above the very first post select Thread Tools, then select Mark this thread as solved.

    It'd also be appreciated if you were to click the add Reputation button at the foot of any of the posts of those who helped you reach a solution.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Why can't I assign an array variable to an array function in my subroutine?
    By redsab in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-16-2017, 10:33 PM
  2. Replies: 3
    Last Post: 04-23-2013, 03:46 PM
  3. HLookup on Lookup Array
    By FTPS in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-01-2011, 02:43 PM
  4. Replies: 5
    Last Post: 07-15-2010, 07:28 PM
  5. Assign sheet value to array... and redim the array size
    By Orange.CL in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-27-2010, 07:18 AM
  6. Replies: 7
    Last Post: 12-18-2008, 07:34 PM
  7. [SOLVED] HLookup? or an array function??
    By Murph in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-11-2005, 01:06 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1