+ Reply to Thread
Results 1 to 7 of 7

return multiple header cell values into one cell concatenated based on a cell value

  1. #1
    Forum Contributor
    Join Date
    06-04-2011
    Location
    Hyderabad
    MS-Off Ver
    Excel 2007
    Posts
    108

    return multiple header cell values into one cell concatenated based on a cell value

    Dear Experts / Members,

    I have a data set where in based on a cell value it should return the multiple headers values into one cell concatenated with comma. I have gone through many posts, but couldn't able to find what i required. Please find attached the image on my requirement for better understanding.

    Untitled.png

    Thanks in advance
    Thanks & Regards
    Chaitanya A

  2. #2
    Forum Expert azumi's Avatar
    Join Date
    12-10-2012
    Location
    YK, Indonesia
    MS-Off Ver
    Excel 2019
    Posts
    2,368

    Re: return multiple header cell values into one cell concatenated based on a cell value

    The results can't be done in 1 cell, if multiple cell yes possible

    =IFERROR(INDEX($A$1:$D$1;SMALL(IF($A$2:$D$2=$E2;COLUMN($A$1:$D$1)-COLUMN($A$1)+1);COLUMNS($A$1:A1)));"")

    put this in cell F2 and push F@ button or doble click to open the formula, and then press all together CTRL+SHIFT+ENTER button, do not ENTER alone, if succed will show curly bracket "{}" that enclosed the formula, last step copied cross and down the formula as necessary

  3. #3
    Forum Contributor
    Join Date
    06-04-2011
    Location
    Hyderabad
    MS-Off Ver
    Excel 2007
    Posts
    108

    Re: return multiple header cell values into one cell concatenated based on a cell value

    Hi Azumi,

    Thanks for the formula, its great.
    I understand that as per your statement its not possible in one cell, but, my concern is to get in one cell. IF using the given formula and dragging to down cannot make my work. There were many rows like row B to its down. I have given just one row example. Could you please help any alternate. I tried dragging to right instead of down if it happens, then thought i can concatenate those cells into one as per the output, but no luck in dragging to right.

  4. #4
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,911

    Re: return multiple header cell values into one cell concatenated based on a cell value

    Try this ...

    Please Login or Register  to view this content.
    Use: =MyConCat(A2:D2,E2,$A$1:$D$1)
    Last edited by Phuocam; 09-12-2016 at 01:14 AM.

  5. #5
    Forum Contributor
    Join Date
    06-04-2011
    Location
    Hyderabad
    MS-Off Ver
    Excel 2007
    Posts
    108

    Re: return multiple header cell values into one cell concatenated based on a cell value

    Hi Phuocam,

    The code is awesome. Worked really perfect. Thanks a lot.
    Small query, instead of the coding is there a way by formula.

  6. #6
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,565

    Re: return multiple header cell values into one cell concatenated based on a cell value

    Formula solution. Use Azumi's array entered formula to create helper columns (H2:K2 in attached file) which may be hidden for aesthetic purposes. Paste the following formula in F2:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Let me know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  7. #7
    Banned User!
    Join Date
    10-14-2006
    Posts
    1,211

    Re: return multiple header cell values into one cell concatenated based on a cell value

    Try this:

    F2: =SUBSTITUTE(TRIM(IF(A2=E2,A$1&" ","")&IF(B2=E2,B$1&" ","")&IF(C2=E2,C$1&" ","")&IF(D2=E2,D$1,""))," ",", ")

+ 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 Cell Value based on Values in Multiple Columns
    By Cardan in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-13-2015, 10:20 PM
  2. Lookup and return multiple values concatenated into one cell
    By funinsum in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-09-2015, 06:26 PM
  3. [SOLVED] Value of cell based on concatenated values
    By Michael Bass in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-19-2014, 11:10 AM
  4. Lookup multiple values concatenated into one cell without duplicates
    By Atul Maskara in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-23-2013, 09:33 AM
  5. [SOLVED] Match multiple substrings in a cell against a lookup table and return concatenated values
    By stevewc in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-13-2013, 10:50 AM
  6. Replies: 10
    Last Post: 12-19-2012, 03:07 PM
  7. Replies: 6
    Last Post: 06-08-2010, 09:42 PM

Tags for this Thread

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