+ Reply to Thread
Results 1 to 5 of 5

VLOOKUP with LEFT & INDIRECT Function

  1. #1
    Registered User
    Join Date
    06-01-2012
    Location
    Hong Kong
    MS-Off Ver
    Excel 2011 (Mac)
    Posts
    13

    VLOOKUP with LEFT & INDIRECT Function

    I am again struggling with the LEFT function, this time in combination with VLOOKUP.

    The following function works well:


    =VLOOKUP(D8,(INDIRECT(F$5&"!$G$9:$M$3000")),7,FALSE)

    This is the number that is looked up in the sheet that is indirectly referred to and of course in the cell D8.
    03-005-1-00

    What I would like to do now is to put only 03-005 in D8 and have that value looked up in the indirectly linked sheet. In my understanding it should look like this:


    =VLOOKUP(D8,(LEFT(INDIRECT(F$5&"!$G$9:$M$3000"),6)),7,FALSE)

    However, it doesn;t work. Any idea about my mistake?

    thanks

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: VLOOKUP with LEFT & INDIRECT Function

    1) What is in D8?
    2) What is in F5?
    3) What is the desired sheetname that would be found as a result?
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    06-01-2012
    Location
    Hong Kong
    MS-Off Ver
    Excel 2011 (Mac)
    Posts
    13

    Re: VLOOKUP with LEFT & INDIRECT Function

    Quote Originally Posted by JBeaucaire View Post
    1) What is in D8?
    2) What is in F5?
    3) What is the desired sheetname that would be found as a result?
    1.) currently "03-005-1-00" which works perfectly well with the formula I wrote first. But should be replaced by 03-005 only.
    2.) "MasterList" is in F5.
    3.) The sheet name is also MasterList

    In "MasterList" Column G has ID Numbers like "03-005-1-00" and corresponding prices in Column M.

    In my sheet with the formula I would like to have only the first 6 Characters in Column D. e.g. D4=03-005 which would lookup the price for "03-005-1-00" in Masterlist.

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: VLOOKUP with LEFT & INDIRECT Function

    Maybe:

    =VLOOKUP(D8&"*",(INDIRECT(F$5&"!$G$9:$M$3000")),7,FALSE)


    ...or if it that specific:

    =VLOOKUP(D8&"-1-00",(INDIRECT(F$5&"!$G$9:$M$3000")),7,FALSE)

  5. #5
    Registered User
    Join Date
    06-01-2012
    Location
    Hong Kong
    MS-Off Ver
    Excel 2011 (Mac)
    Posts
    13

    Re: VLOOKUP with LEFT & INDIRECT Function

    Thanks a lot. First one works perfect. 2nd solution is not suitable since I will not have the -1-00 in "D" column. Thanks again - problem solved.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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