+ Reply to Thread
Results 1 to 13 of 13

Return Multiple Column headers from row title and content?

  1. #1
    Registered User
    Join Date
    09-11-2012
    Location
    Hinckley, England
    MS-Off Ver
    Excel 2007
    Posts
    16

    Return Multiple Column headers from row title and content?

    Good day everyone,

    Can any experts point me in the right direction... I'm looking for a solution to this, I need to bring a list of column headers based on the row contents.

    If a row heading is selected, I need it to return each column header with a tick (capital P) in the intersecting cell.

    I tried using =IF(VLOOKUP(CELL,DATA,COLUMN HEADER,0)="P","1.1","")&IF ......... extending this all the way through and it works but I feel there is a shorter way I'm missing.
    I tried a fiddle with a couple of UDF but could never get them to work right.

    Can anyone please help me with a solution to this?
    Attached Files Attached Files

  2. #2
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,237

    Re: Return Multiple Column headers from row title and content?

    Is this what you mean....When you click in the cell, a "P" must be entered...
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  3. #3
    Registered User
    Join Date
    09-11-2012
    Location
    Hinckley, England
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Return Multiple Column headers from row title and content?

    I'm sorry that's not what I'm looking for I'm afraid, the table attached was just for reference.

    I want to reference that data and bring back the column header for each "P" in the row.
    for instance,
    in a separate cell i type "HCD" and then the adjacent cell gives me the result of 1.1, 1.3, 1.4, 1.5, 2.1 and 2.3

    Just a list of all the column headers from row reference?

  4. #4
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Return Multiple Column headers from row title and content?

    Maybe with this array formula
    Formula entered in K2 and copied across and down
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    **Must be entered with Ctrl+Shift+Enter key combination.
    Attached Files Attached Files
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  5. #5
    Registered User
    Join Date
    09-11-2012
    Location
    Hinckley, England
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Return Multiple Column headers from row title and content?

    Yeah, I think I can work with that, thank you.

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Return Multiple Column headers from row title and content?

    UDF
    Use in cell like
    =GetHeaders(A2,$B$1:$I$1,B2:I2,", ")
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    09-11-2012
    Location
    Hinckley, England
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Return Multiple Column headers from row title and content?

    Thank you for the reply Jindon, unfortunately, I can't seem to figure out this one, keeps giving me a #name error. And because i do not really understand the udf i cannot figure out why it is giving me the error.

  8. #8
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Return Multiple Column headers from row title and content?

    See the attached.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    09-11-2012
    Location
    Hinckley, England
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Return Multiple Column headers from row title and content?

    Right, amazing! I'm with you! Is there a way to apply that to a separate worksheet with a data validation list to select the row title?

  10. #10
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Return Multiple Column headers from row title and content?

    See the attached.
    =GetHeaders(A1,Sheet1!A1:I8,", ")
    Please Login or Register  to view this content.
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    09-11-2012
    Location
    Hinckley, England
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Return Multiple Column headers from row title and content?

    Amazing!

    Last point, why is it bring back the zero at the start?

    Sorry to be a pain, but my VBA is very weak!

  12. #12
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Return Multiple Column headers from row title and content?

    OOps of course,
    1) Change the formula in B1 to
    =IFERROR(GetHeaders(A1,Sheet1!A1:I8,"p",", "),"")

    2) Change the code to
    Please Login or Register  to view this content.

  13. #13
    Registered User
    Join Date
    09-11-2012
    Location
    Hinckley, England
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Return Multiple Column headers from row title and content?

    That is fantastic! Thank you so much, this should save a ton of time.

+ 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. Replies: 3
    Last Post: 07-28-2016, 10:54 AM
  2. [SOLVED] return row and column headers
    By learner81 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-11-2015, 08:55 PM
  3. Inserting column headers text before the content of each cell in a column
    By Spacedone in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-27-2014, 10:18 AM
  4. Search for value in multiple columns, Return Column Headers
    By Zach51215 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-30-2013, 06:49 AM
  5. [SOLVED] Return multiple values from another workbook, based on Column Headers in other workbook
    By GoGators in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-17-2013, 02:11 PM
  6. Replies: 2
    Last Post: 05-09-2012, 01:30 PM
  7. return a value based on column and row headers
    By jimmy1981 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-01-2012, 11:02 AM

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