+ Reply to Thread
Results 1 to 6 of 6

Need help on Concatenate in pivot

  1. #1
    Registered User
    Join Date
    07-07-2020
    Location
    London
    MS-Off Ver
    2013
    Posts
    3

    Need help on Concatenate in pivot

    Hi, I have a pivot table and I am trying to link all the rows in column C

    For example

    Name Location Description
    Jessie England Blue
    Green
    White
    Yellow

    I want the result to come out like this

    Jessie England Blue, Green, White, Yellow

    I have 1,000 rows on a pivot table that are similar to that. Any help will be appreciated. Thanks.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Need help on Concatenate in pivot

    To best describe or illustrate your problem you would be better off attaching a dummy workbook. The workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    07-07-2020
    Location
    London
    MS-Off Ver
    2013
    Posts
    3

    Re: Need help on Concatenation

    I uploaded the file. Please let me know if you guys see it.

    My desired results are column E to column G. If that is not doable, getting column G is fine too. This is just dummy data. My original file has 1,000 rows I have to concatenate and I want to see if there is a sufficient way of doing it.
    Attached Files Attached Files
    Last edited by klum2015; 07-08-2020 at 11:40 PM.

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

    Re: Need help on Concatenate in pivot

    Hello klum2015 and Welcome to Excel Forum.
    This proposal adds two helper columns (D:E) which may be moved and/or hidden for aesthetic purposes.
    The first helper is populated using: =IF(A3<>"",C3,D2&" "&C3)
    The second helper is populated using: =IF(C4="",1,0)
    Of the result columns the Name and Location columns are populated using: =IF(A3="","",A3)
    The Description column is populated using: =IF(H3="","",INDEX(D$3:D$20,AGGREGATE(15,6,(ROW(D$3:D$20)-ROW(D$2))/(E$3:E$20=1),COUNTIFS(H$3:H3,"?*"))))
    Let us 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.

  5. #5
    Registered User
    Join Date
    07-07-2020
    Location
    London
    MS-Off Ver
    2013
    Posts
    3

    Re: Need help on Concatenate in pivot

    Thanks for writing me a formula. Can you help understand a little bit more of the formula you have written?

    For instance, why is 15 used in the aggregate formula and what is the purpose of the 2nd helper?

    Since I have more rows than what is in the spreadsheet, I will have to extend the formula. I try extending the range of the formula but I am not getting results.

    Thank you very much.
    Last edited by klum2015; 07-14-2020 at 07:18 PM.

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

    Re: Need help on Concatenate in pivot

    The 15 is the SMALL function. (See information on AGGREGATE)
    The second helper column's purpose is to indicate, with a 1, the rows in which the list of descriptions are completed for each name.
    To extend the INDEX/AGGREGATE formula's range change all of the 20's to the maximum number of rows.
    I.E. if there are 1000 rows then the formula should read: =IF(H3="","",INDEX(D$3:D$1000,AGGREGATE(15,6,(ROW(D$3:D$1000)-ROW(D$2))/(E$3:E$1000=1),COUNTIFS(H$3:H3,"?*"))))
    All other formulas should be copied down as far as the last row containing a description.
    Let us know if you have any questions.

+ 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] CONCATENATE fields in pivot table with vlookup
    By sachbo in forum Excel General
    Replies: 8
    Last Post: 08-11-2015, 08:00 AM
  2. Concatenate option in pivot
    By sryadav12 in forum Excel General
    Replies: 1
    Last Post: 08-10-2015, 03:32 PM
  3. Excel 2007 : Concatenate specified cells from pivot table
    By cactusrmt in forum Excel General
    Replies: 4
    Last Post: 12-05-2012, 09:19 AM
  4. Concatenate Pivot Table fields based on criteria
    By dluhut in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-09-2012, 12:52 PM
  5. replace a CONCATENATE from pivot table with fx to raw data
    By ggremel in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 04-03-2011, 09:32 PM
  6. Replies: 2
    Last Post: 04-12-2010, 12:35 PM
  7. Concatenate pivot table
    By 0nyx175 in forum Excel General
    Replies: 2
    Last Post: 02-08-2010, 11:25 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