+ Reply to Thread
Results 1 to 6 of 6

Create Dynamic Column Lookup Reference based on Table Header

  1. #1
    Forum Contributor
    Join Date
    01-17-2012
    Location
    Canada
    MS-Off Ver
    Excel 365
    Posts
    221

    Create Dynamic Column Lookup Reference based on Table Header

    Hi Folks,

    In the "Lookup" tab (see attached) I am trying to use an Index & Match formula to return a date from the "Dbase Export" tab, based on the column headings defined in the "Reference" tab.

    For example;
    On the reference tab, we've assigned the milestone "Milestone_date2" the heading IFS (depending on the project these milestones can change based on client requirements, hence the need for this to be dynamic).

    The index & match formula I have so far determines the header to search for. All I need to do now is include a formula that uses this header and converts it to a searchable column array.

    Hope this makes sense. The attachement should be pretty self explanatory.

    column lookup.xlsx
    Regards,

    jeversf

  2. #2
    Forum Expert
    Join Date
    09-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    2,278

    Re: Create Dynamic Column Lookup Reference based on Table Header

    Hello
    In cell B8 copied across and down:

    Please Login or Register  to view this content.
    This is just referencing your sample data, you would of course need to expand the ranges as needed.

    Hope this helps.
    DBY

  3. #3
    Forum Contributor
    Join Date
    01-17-2012
    Location
    Canada
    MS-Off Ver
    Excel 365
    Posts
    221

    Re: Create Dynamic Column Lookup Reference based on Table Header

    Thanks for that DBY. It works well but was hoping to not have to use HLOOKUP, is there an alternative that uses index & match instead?
    The only reason I ask is that the data on the Dbase Export master file will have several thousand line items and the number of line items will increase on a daily/weekly basis. I don't really want to have to change the size of the HLOOKUP table array every time I import the database export.

    The following portion of the formula allows me to find the column in question to search, I just need an Index & Match that can reference this column as an array:

    INDEX(reference!$A$1:$A$10,MATCH(B$7,reference!$B$1:$B$10,0))

  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,929

    Re: Create Dynamic Column Lookup Reference based on Table Header

    If DBY's formula doesnt work for you, try this, copied down and across...
    =INDEX('Dbase Export'!$B$5:$BO$8,MATCH(Lookup!$A8,'Dbase Export'!$B$5:$B$8,0),MATCH(INDEX(reference!$A$1:$B$10,MATCH(Lookup!B$7,reference!$B$1:$B$10,0),1),'Dbase Export'!$B$5:$BO$5,0))
    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

  5. #5
    Forum Contributor
    Join Date
    01-17-2012
    Location
    Canada
    MS-Off Ver
    Excel 365
    Posts
    221

    Re: Create Dynamic Column Lookup Reference based on Table Header

    Thanks for that FDibbins, works like a charm!

  6. #6
    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,929

    Re: Create Dynamic Column Lookup Reference based on Table Header

    Happy to help, and thanks for the rep

+ 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