+ Reply to Thread
Results 1 to 4 of 4

HELP: Column Header as a Variable(Structure Referencing)

  1. #1
    Registered User
    Join Date
    06-29-2015
    Location
    Manila, Philippines
    MS-Off Ver
    2013
    Posts
    12

    HELP: Column Header as a Variable(Structure Referencing)

    Hi, Good day! Currently experimenting and trying out functions in excel, hope you guys can help me out. Thanks in advance!

    I have two tables, TableA and TableB(see screenshot below), in TableB there is a "Customer" column similar to TableA, I want to display the Column INDEX number of the Customer, for VLookup purposes.

    TableA and TableB.JPG


    Now, I have this function under "Customer" of TableB
    =VLOOKUP([Mobile],TableA,COLUMN(TableA[Customer]),FALSE)

    Now, the function above works fine but w I want to automatically get the name of the Column Header of TableB so I won't have to retype the formula or edit the formula.

    I tried this formula but it doesn't work for me even with indirect

    =VLOOKUP([Mobile],TableA,COLUMN(TableA[TableB[#Headers]]),FALSE)

    I tested with Indirect, still doesn't work

    COLUMN(INDIRECT("TableA[TableB[#Headers]]")

    Kindly help, thanks!
    Last edited by nori79; 07-14-2015 at 11:26 PM. Reason: Solved

  2. #2
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,876

    Re: HELP: Column Header as a Variable(Structure Referencing)

    Maybe something like this

    =VLOOKUP([Mobile],TableA[#All],MATCH("Customer",TableA[#Headers],0),0)
    Last edited by NeedForExcel; 07-08-2015 at 02:14 AM.
    Cheers!
    Deep Dave

  3. #3
    Registered User
    Join Date
    06-29-2015
    Location
    Manila, Philippines
    MS-Off Ver
    2013
    Posts
    12

    Re: HELP: Column Header as a Variable(Structure Referencing)

    Quote Originally Posted by NeedForExcel View Post
    Maybe something like this

    =VLOOKUP([Mobile],TableA[#All],MATCH("Customer",TableA[#Headers],0),0)
    Great Thanks! I just replaced "Customers" with TableB[#Headers] and it worked! Now let me try on one of my trackers

    MATCH(TableB[#Headers],TableA[#Headers])

  4. #4
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,876

    Re: HELP: Column Header as a Variable(Structure Referencing)

    Glad it helped!

+ 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] Macro to create columns by referencing a variable column
    By mactoolsix in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-11-2014, 05:19 PM
  2. Replies: 10
    Last Post: 08-01-2013, 06:25 AM
  3. [SOLVED] How to find Column with a header that has a variable that changes evry week
    By JMG14 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-08-2012, 08:20 AM
  4. Referencing column as a variable using Range?
    By MikeSD in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-10-2012, 07:22 PM
  5. Referencing column header instead of column label
    By mremmenga in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-23-2008, 01:12 PM

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