+ Reply to Thread
Results 1 to 4 of 4

variable cell location for VLOOKUP

  1. #1
    Registered User
    Join Date
    05-27-2013
    Location
    Salmon arm
    MS-Off Ver
    Excel 2007
    Posts
    2

    variable cell location for VLOOKUP

    so I'm trying to get a VLOOKUP search to work, I've got it working just fine using manual input of the table placement, but I want to be able to have some cells with the table size or locations in them so I can change that and have the entire table change at once.

    right now I've got
    =VLOOKUP(B4,'LP mod cost'!C$2:Y$50,23,FALSE)
    and that works just fine, but now I'm trying to use indirect to point to 2 cells that would direct to C2 and Y50, and that seems to be causing issues.
    =VLOOKUP(B2,'LP mod cost'!(INDIRECT(P2))INDIRECT(P3)),23,FALSE)
    I've been working on this while a bit sleep deprived so I might be missing something really simple, but right now it's just confusing me.

    I've attached the file I'm working on (or at least I think I have, it's just hanging there and the page is not responding) so that you can see what I'm doing. I've got 3 sheets grabbing information from XMLs off a web server, and that's the information I'm trying to reference.

    EDIT: damn smilies. that's supposed to be VLOOKUP(B2,'LP mod cost'!(INDIRECT(P2)) : (INDIRECT(P3)),23,FALSE) without the spaces between the indirect functions and the colon.
    Attached Files Attached Files
    Last edited by kerradeph; 05-27-2013 at 12:58 PM.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: variable cell location for VLOOKUP

    Hi and welcome to the forum

    you were almost there.....
    =VLOOKUP(B2,INDIRECT("'LP mod cost'!"&P2&":"&P3),23,FALSE)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    05-27-2013
    Location
    Salmon arm
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: variable cell location for VLOOKUP

    wow, that's quick. thank you. I've never used either of those functions before, so I was somewhat blindly stumbling around trying to get them to work. I more or less figured out VLOOKUP, but I'd never even seen indirect until it was suggested for what I was trying to do.

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: variable cell location for VLOOKUP

    Happy to help

+ 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