+ Reply to Thread
Results 1 to 14 of 14

Duplicate row headers, different data – how to combine it all into unique row headers

  1. #1
    Registered User
    Join Date
    08-28-2020
    Location
    NYC
    MS-Off Ver
    2016
    Posts
    7

    Duplicate row headers, different data – how to combine it all into unique row headers

    Hello,
    This is my 1st time posting here. So, if I made a faux pas, apologies in advance. What I would like to know if there’s a way to combine rows of data into a unique row based upon the row headers in column A? I do NOT want to merge data into 1 cell. I do NOT want to consolidate with sums totals. I just want to know if there’s a way (formula or VBA or other) where I can combine row data into one row based on duplicate row headers or row titles. Here’s an example below of "Before & After". The Letters denote column letters in Excel – I’ve added them to show that row lengths would need to increase based on the data. Also, the combine data doesn’t have to be alpha-numeric order, but nice if possible. And yes, those are Portuguese words, but it’s based on an actual file dump I’ve received.


    Original data file - Before
    A B C D F G H I
    Jan2015 acidente adorável animal
    Jan2015 automóvel bagagem catedral central
    Feb2015 ciclista condutor conversível
    Feb2015 crime cruel elefante famoso
    Mar2015 fisico futebol hospital relógio difícil
    Mar2015 hotel humor importante
    Apr2015 inevitável informação inventar local
    Apr2015 motor natural plano
    Apr2015 popular potente presidente
    Apr2015 sinistro telefone
    May2015 ator criatura música idéia
    Jun2015 rádio conversível futebol
    Jun2015 favor
    Jul2015 respeitável Beleza
    Aug2015 Falou táxi Valeu Rolar Joia
    Aug2015 carne de boi Pão-duro segundo semana água


    The Ideal - After
    A B C D F G H I J K L M N
    Jan2015 acidente bagagem adorável animal automóvel catedral central
    Feb2015 ciclista condutor conversível crime cruel elefante famoso
    Mar2015 hotel fisico futebol hospital humor importante relógio difícil
    Apr2015 inevitável informação inventar local motor natural popular plano potente presidente sinistro telefone
    May2015 ator criatura música idéia
    Jun2015 rádio conversível futebol favor
    Jul2015 respeitável Beleza
    Aug2015 Falou táxi Valeu Rolar Pão-duro carne de boi Joia água

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,419

    Re: Duplicate row headers, different data – how to combine it all into unique row headers

    Welcome to the forum.

    Impossible to say for sure without a workbook, but should be do-able with PowerQuery.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Expert nankw83's Avatar
    Join Date
    08-31-2015
    Location
    Kuwait
    MS-Off Ver
    365
    Posts
    1,712

    Re: Duplicate row headers, different data – how to combine it all into unique row headers

    Hi fikkie2002 & welcome to the forum

    As Ali said, it's bit difficult to suggest a solution without a file but if my understanding is correct, give the below VBA code a try & see if it does what you need

    Quote Originally Posted by fikkie2002 View Post
    I just want to know if there’s a way (formula or VBA or other) where I can combine row data into one row
    Please Login or Register  to view this content.
    If I was able to help, you can thank me by clicking the * Add Reputation under my user name

  4. #4
    Registered User
    Join Date
    08-28-2020
    Location
    NYC
    MS-Off Ver
    2016
    Posts
    7

    Re: Duplicate row headers, different data – how to combine it all into unique row headers

    Thanks nankw83. This works. I did try attaching the file with the attach icon, but I keep getting a blank field. BTW, could be VBA be used if there is duplicate column headers - if rows are sub for columns and vice versa within the code?

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,419

    Re: Duplicate row headers, different data – how to combine it all into unique row headers

    There are instructions at the top of the page explaining how to attach your sample workbook.

  6. #6
    Registered User
    Join Date
    08-28-2020
    Location
    NYC
    MS-Off Ver
    2016
    Posts
    7

    Re: Duplicate row headers, different data – how to combine it all into unique row headers

    Thanks Ali, once I used that VBA code fromnankw83, I then was able to use Power Query to make other changes. And I did try to attach the file with the attch icon, but I kept getting a blank field

  7. #7
    Forum Expert nankw83's Avatar
    Join Date
    08-31-2015
    Location
    Kuwait
    MS-Off Ver
    365
    Posts
    1,712

    Re: Duplicate row headers, different data – how to combine it all into unique row headers

    Quote Originally Posted by fikkie2002 View Post
    BTW, could be VBA be used if there is duplicate column headers - if rows are sub for columns and vice versa within the code?
    I would love to help but I am really not be able to visualize this. Please try again to attach a sample file following the instructions at the top of the page as suggested by Ali

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,419

    Re: Duplicate row headers, different data – how to combine it all into unique row headers

    Quote Originally Posted by fikkie2002 View Post
    And I did try to attach the file with the attch icon, but I kept getting a blank field
    Then you were not following the instructions that I suggested you follow at the top of the page. Here they are:

    Just before posting, scroll down to GO ADVANCED, click, and then scroll down to MANAGE ATTACHMENTS and click again. Now follow the instructions at the top of that screen.

  9. #9
    Registered User
    Join Date
    08-28-2020
    Location
    NYC
    MS-Off Ver
    2016
    Posts
    7

    Re: Duplicate row headers, different data – how to combine it all into unique row headers

    File is attached.
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    08-28-2020
    Location
    NYC
    MS-Off Ver
    2016
    Posts
    7

    Re: Duplicate row headers, different data – how to combine it all into unique row headers

    nankw83, I've attached the file in a separate post. Let me know if you have any questions. Thanks.

  11. #11
    Registered User
    Join Date
    08-28-2020
    Location
    NYC
    MS-Off Ver
    2016
    Posts
    7

    Re: Duplicate row headers, different data – how to combine it all into unique row headers

    Thanks Ali. I was able to attach the file

  12. #12
    Forum Expert nankw83's Avatar
    Join Date
    08-31-2015
    Location
    Kuwait
    MS-Off Ver
    365
    Posts
    1,712

    Re: Duplicate row headers, different data – how to combine it all into unique row headers

    Hi fikkie2002,

    Try the below macro based on your sample file, once you run the code a message box will pop-up asking you "Run macro for Horizontal data?" with 3 options Yes, No or Cancel ... Yes will run the code for Horizontal no will run for Vertical & cancel will abort the macro

    Please Login or Register  to view this content.

  13. #13
    Registered User
    Join Date
    08-28-2020
    Location
    NYC
    MS-Off Ver
    2016
    Posts
    7

    Re: Duplicate row headers, different data – how to combine it all into unique row headers

    Thanks nankw83. This works perfectly.

  14. #14
    Forum Expert nankw83's Avatar
    Join Date
    08-31-2015
    Location
    Kuwait
    MS-Off Ver
    365
    Posts
    1,712

    Re: Duplicate row headers, different data – how to combine it all into unique row headers

    Glad to help & thanks for your feedback

    Please take a moment & mark this thread as [SOLVED] from the Thread Tools above your first post

+ 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. Filter Data Set using Row Headers in lieu of Column Headers
    By bsnell in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 07-30-2019, 11:43 AM
  2. [SOLVED] dynamic vba code to delete duplicate headers, blank headers and blank columns
    By JEAN1972 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-14-2017, 02:27 PM
  3. Replies: 0
    Last Post: 02-24-2016, 04:04 PM
  4. [SOLVED] How to Copy a filter data with headers, excluding the headers?
    By Elomaldo in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-16-2014, 03:35 PM
  5. Replies: 4
    Last Post: 02-08-2014, 02:31 PM
  6. Replies: 3
    Last Post: 09-30-2010, 12:30 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