+ Reply to Thread
Results 1 to 9 of 9

Concatenate dynamic Column values with column header

  1. #1
    Registered User
    Join Date
    04-19-2005
    Posts
    8

    Concatenate dynamic Column values with column header

    Hi all, I'm hoping someone can help with my problem.

    I need a formula which can concatenate the values in a row along with its corresponding column header and sub header descriptions, I've been trying to work with Offset, Lookup and Concatenate but am struggling to get a solution.


    Formula_example.PNG

    Many thanks for your help in advance!

  2. #2
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: Concatenate dynamic Column values with column header

    If you have Excel 2016 you can do this with TEXTJOIN. Note this is an array formula entered with Ctrl+Shift+Enter:

    wbd2018092701.PNG

    WBD
    Office 365 on Windows 11, looking for rep!

  3. #3
    Registered User
    Join Date
    04-19-2005
    Posts
    8

    Re: Concatenate dynamic Column values with column header

    Hi, although a few users might have Excel 2016 the majority will still be using 2007 and this is a template that is sent in by many different teams, is there an alternative to this in 2007 (I assume using Concat or similar)?

    Just to mention I need to import this spreadsheet with SSIS without doing any pre-import steps like running any vba etc...

    Many thanks again!

  4. #4
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,597

    Re: Concatenate dynamic Column values with column header

    Does UDF will do.
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  5. #5
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2404
    Posts
    13,406

    Re: Concatenate dynamic Column values with column header

    Limited to 2007 and no VBA all I have is brute force.

    Formula: copy to clipboard
    Please Login or Register  to view this content.



    A
    B
    C
    D
    E
    F
    G
    1
    Sale
    Sale
    Return
    Sale
    Return
    2
    Market
    Formula
    TV
    Bike
    PC
    Fridge
    Cooker
    3
    Market A
    Sale-TV(2), Return-PC(5), Sale-Fridge(3)
    2
    5
    3
    4
    Market B
    Sale-Bike(1), Sale-Fridge(2)
    1
    2
    5
    Market C
    Sale-TV(2), Sale-Bike(4)
    2
    4
    Dave

  6. #6
    Registered User
    Join Date
    04-19-2005
    Posts
    8

    Re: Concatenate dynamic Column values with column header

    Hi, thanks for the effort!

    I was thinking similar but was hoping there might be a way of using dynamic range with offset or something, but the problem is the columns can go over 100 so think the formula string would go over its limit, also the columns will be increasing once in a while (although that’s not the biggest issue).

  7. #7
    Registered User
    Join Date
    04-19-2005
    Posts
    8
    Quote Originally Posted by kvsrinivasamurthy View Post
    Does UDF will do.
    Hi, thanks for the suggestion, however this is an option I was trying to avoid as it relies on users always using the explicit template file where as I’m sure there will be instances they copy the data into another file and re-save hence the UDF won’t be copied over, also the variance in file extension makes my SSIS import it’s a little more complex.

    Although a UDF may have to be a very last resort 😖

  8. #8
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: Concatenate dynamic Column values with column header

    Try this:

    A B C D E F G
    1 Sale Sale Return Sale Return
    2 Market Formula TV Bike PC Fridge Cooker
    3 Market A Sale-TV(2), Return-PC(5), Sale-Fridge(3) 2 5 3
    4 Market B Sale-Bike(1), Sale-Fridge(2) 1 2
    5 Market C Sale-TV(2), Sale-Bike(4) 2 4

    Array Formulas
    Cell Formula
    B3 {=MID(CONCAT(IF($C3:$G3>0,", "&$C$1:$G$1&"-"&$C$2:$G$2&"("&$C3:$G3&")","")),3,1024)}
    Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
    Note: Do not try and enter the {} manually yourself

    WBD

  9. #9
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2404
    Posts
    13,406

    Re: Concatenate dynamic Column values with column header

    @ rockyboy

    Concatenating an array with formulas only (non 365 (2016)) remains a mystery. Most of us are hesitant to say it can't be done without VBA, but we suspect it is.

    For now with the limitations of 2007 is appears VBA / UDF is your only option, and you should be able to make an *.xlmt macro enabled template.

+ 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: 8
    Last Post: 03-23-2017, 02:59 PM
  2. If column range contains specified column, concatenate matching values
    By johndon in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-14-2016, 04:40 PM
  3. Concatenate column values based on another column's duplicates
    By Jyos in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-28-2014, 06:36 PM
  4. Concatenate keys based off column Header
    By NYC4LIFE in forum Excel General
    Replies: 2
    Last Post: 07-26-2013, 03:33 PM
  5. [SOLVED] Concatenate the values in a column one by one with multiple entries in another column
    By Pavan Renjal in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-11-2013, 08:13 AM
  6. Concatenate values in a column based on value of previous column
    By CountySurveyor in forum Excel General
    Replies: 3
    Last Post: 10-02-2012, 06:38 PM
  7. Search for column header and find all values and their row numbers in that column
    By woody83 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-14-2012, 03:11 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