+ Reply to Thread
Results 1 to 7 of 7

How to transpose data so column A is grouped and works as a header for column b

  1. #1
    Registered User
    Join Date
    07-15-2020
    Location
    Denmark
    MS-Off Ver
    Office 365
    Posts
    9

    How to transpose data so column A is grouped and works as a header for column b

    Hello

    I have about 250.000 rows of data which consist of data about cadastres (I think is the English word). I would like that my Column A which has an overall location listed (there is 1205 unique overall locations) is used as a header for all the cadastres within that area.

    As far as I can understand, I might need some VBA to transpose and group my data? I tried to do a Cross-join via Access, without much luck, so I'm hoping someone here can lead me on the right track.
    Attached Images Attached Images
    Attached Files Attached Files

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

    Re: How to transpose data so column A is grouped and works as a header for column b

    IN L2 copied across

    =IFERROR(INDEX($A:$A,AGGREGATE(15,6,ROW($A$2:$A$50)/(($A$2:$A$50<>"")*ISERROR(MATCH($A$2:$A$50,$K$2:K$2,0))),1)),"")

    In L3 copied across and down

    =IFERROR(INDEX($B:$B,AGGREGATE(15,6,ROW($B$2:$B$50)/(($B$2:$B$50<>"")*($A$2:$A$50=L$2)),ROWS(L$2:L2))),"")
    Attached Files Attached Files
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  3. #3
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: How to transpose data so column A is grouped and works as a header for column b

    It is an English word... but far from being a commonly used one!!

    FILTER($B$2:$B$39,$A$2:$A$39=E$2)

    copied across. In DK, you may need to use ; instead of ,
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: How to transpose data so column A is grouped and works as a header for column b

    and this in E2 to return the names:

    =TRANSPOSE(UNIQUE(A2:A39,FALSE))
    Attached Files Attached Files

  5. #5
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,702

    Re: How to transpose data so column A is grouped and works as a header for column b

    an alternative solution is to Pivot your data in Power Query as shown in the Mcode below. One of the advantages of using PQ is that any updates to the source data is automatically reflected in the output once Refresh All is clicked.

    Please Login or Register  to view this content.
    Power Query is a free AddIn for Excel 2010 and 2013, and is built-in functionality from Excel 2016 onwards (where it is referred to as "Get & Transform Data").

    It is a powerful yet simple way of getting, changing and using data from a broad variety of sources, creating steps which may be easily repeated and refreshed. I strongly recommend learning how to use Power Query - it's among the most powerful functionalities of Excel.

    - Follow this link to learn how to install Power Query in Excel 2010 / 2013.

    - Follow this link for an introduction to Power Query functionality.

    - Follow this link for a video which demonstrates how to use Power Query code provided.
    Attached Files Attached Files
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  6. #6
    Registered User
    Join Date
    07-15-2020
    Location
    Denmark
    MS-Off Ver
    Office 365
    Posts
    9

    Re: How to transpose data so column A is grouped and works as a header for column b

    Filters work really well Glenn, so that's the solution I'm going with. #1 solution worked as well, but was a bit too slow for the amount of data.

    Appreciate your time and help!

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: How to transpose data so column A is grouped and works as a header for column b

    That's the beauty of Dyanmic arrays. If you have 100 unique names and 1,000,000 rows, the whole thing is completed by the calculation of 1+100 cells containing formulae. AGGREGATE is so versatile, but has many, many TIMES more calculations to perform to get there.

+ 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. Transpose multirows from two column into single row with one header
    By qiyusi in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-31-2015, 09:14 PM
  2. [SOLVED] Excel 2013 - Header Info in Column A - Transpose Question
    By alyzar in forum Excel General
    Replies: 4
    Last Post: 04-07-2015, 02:19 PM
  3. VBA code to convert multiple rows as column header grouped by unique key
    By Shreyas11 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-24-2014, 09:03 PM
  4. Replies: 1
    Last Post: 02-24-2014, 10:05 AM
  5. [SOLVED] Select Header Row and Transpose to a Column in a New Worksheet
    By Kespin in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-17-2013, 06:16 PM
  6. Replies: 9
    Last Post: 07-22-2012, 12:03 PM
  7. Transpose multiple rows to one column keping the row header.
    By cinciphantom in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-18-2011, 06:42 AM

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