+ Reply to Thread
Results 1 to 7 of 7

Return column header

  1. #1
    Registered User
    Join Date
    06-06-2014
    Posts
    6

    Return column header

    I am needing to filter by a given company and only return header rows if there is a value "x" in that column. So for my example: I want to filter by company a and see product 3, or company b and see product 1 and product 2, company c would be product 4, etc. I would like to do this via a pivot table or other simple method. Any help would be greatly appricated!! I'm in a crunch so hoping someone can assist. Thanks so much!!!

    Account Product 1 Product 2 Prodcut 3 Product 4
    Company a x
    Company b x x
    Company c x
    Company d x

  2. #2
    Registered User
    Join Date
    06-06-2014
    Posts
    6

    Re: Return column header

    My example did not show up correctly, hopefully this picture will go through.
    spreadsheet.jpg

  3. #3
    Registered User
    Join Date
    06-06-2014
    Posts
    6

    Re: Return column header

    Anyone have a suggestion?

  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 column header

    For this example enter array formula in G2 and pull it to the right to column J and then down

    =IFERROR(INDEX($B$1:$E$1,SMALL(IF($B2:$E2="x",COLUMN($B2:$E2)-1),COLUMNS($A:A))),"")


    ***Array formula must be entered by using key combination of CTRL+SHIFT+ENTER and not just ENTER

    Row\Col
    A
    B
    C
    D
    E
    F
    G
    H
    I
    J
    1
    Account Product 1 Product 2 Product 3 Product 4 Results
    2
    Company a x Product 3
    3
    Company b x x Product 1 Product 2
    4
    Company c x Product 4
    5
    Company d x Product 1
    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
    06-06-2014
    Posts
    6

    Re: Return column header

    Thanks so much!!

  6. #6
    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 column header

    You're welcome and thank you for the feedback!

    Please mark thread as "Solved" if your issue has been resolved. (Selecting Thread Tools -> Mark thread as Solved).

  7. #7
    Registered User
    Join Date
    06-06-2014
    Posts
    6

    Thumbs up Re: Return column header

    Solved thanks everyone!!

+ 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. Return column header based on column criteria and number value
    By bwill22 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-07-2014, 07:33 PM
  2. [SOLVED] Find specific value in table and return header row and header column value
    By nelwan in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-30-2013, 01:35 AM
  3. Replies: 4
    Last Post: 03-13-2013, 12:38 PM
  4. Return value under column header
    By milty456 in forum Excel General
    Replies: 2
    Last Post: 09-28-2012, 11:13 PM
  5. Way to return a column header value?
    By Abgirl in forum Excel General
    Replies: 2
    Last Post: 05-20-2011, 12:39 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