+ Reply to Thread
Results 1 to 5 of 5

Convert rows to columns while consolidating Column A

  1. #1
    Registered User
    Join Date
    05-06-2013
    Location
    Michigan, USA
    MS-Off Ver
    Excel 2010
    Posts
    2

    Question Convert rows to columns while consolidating Column A

    Hi All, long time viewer, first-time poster.

    My problem looks like this:
    1 a
    1 b
    1 c
    2 d
    2 e
    2 f

    My goal is for it to look like this:
    1 2
    a d
    b e
    c f

    I've tried to use a pivot table, but as it turns out, only numbers work as values, not text, which is what my data is.

    I also tried to do a lookup, but I only got the first response each time. I think there should be a way to iterate through each row where A=1 and get the value B for that row. So far I've not come up with much. I want to be able to have a 'dynamic' sheet with the forumla and layout pre-set and the data sheet can be updated as needed.

    Any help would be appreciated.
    I've attached a sample workbook.
    Attached Files Attached Files

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,887

    Re: Convert rows to columns while consolidating Column A

    Something like below?
    1. Extract unique values from Column A.
    In B1: Confirmed as array (CTRL + SHIFT + ENTER)
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Copy across as much as needed (until you see blank).

    2. Extract values that match header.
    In B2: Confirmed as array (CTRL + SHIFT + ENTER)
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Copy across and down as much as needed (until you see blank across all columns with header value).

    See attached.
    Attached Files Attached Files
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,731

    Re: Convert rows to columns while consolidating Column A

    Put this formula in C1 of the Data sheet:

    =IF(A1="","",A1&"_"&COUNTIF(A$1:A1,A1))

    Copy it down to the bottom of your data (or beyond). Then you can use this formula in A2 of the Desired sheet:

    =IFERROR(INDEX(Data!$B:$B,MATCH(A$1&"_"&ROWS($1:1),Data!$C:$C,0)),"")

    Copy this across and down, as required.

    Hope this helps.

    Pete

    EDIT: This assumes that you already have the headers in row 1 of the Desired sheet.

    Pete

  4. #4
    Registered User
    Join Date
    05-06-2013
    Location
    Michigan, USA
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Convert rows to columns while consolidating Column A

    Thanks, Pete! Your solution worked great.

    CK76, Thanks for your reply. I had some trouble connecting your formulas to my data. But it sounds like it would automaticly generate my Row1, which would have been nice. I'll be gone for the weekend, but I'll try your formula again Monday.

  5. #5
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,731

    Re: Convert rows to columns while consolidating Column A

    Glad to help, Noel.

    If that takes care of your original question, please take a moment to select Thread Tools from the menu above and to the right of your first post and mark this thread as SOLVED.

    Also, since you are relatively new to the forum, you might like to know that you can directly thank those who have helped you by clicking on the small "star" icon located in the lower left corner of a post that you have found to be helpful (not just in this thread - for any post that has helped you). This also adds to the reputation of the poster (the small green bars in the poster's profile).

    Pete

+ 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] Convert multiple columns into rows with row and column titles
    By nnklem in forum Excel General
    Replies: 2
    Last Post: 09-27-2016, 04:23 PM
  2. [SOLVED] How to transpose / convert columns and rows into single column?
    By chief_abound in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-09-2015, 08:04 PM
  3. [SOLVED] Consolidating multiple rows and transposing data across columns
    By RufusParker in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 02-06-2015, 01:31 PM
  4. [SOLVED] Consolidating similar rows with unique columns
    By nandaopira in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-22-2014, 04:56 PM
  5. Need VBA to Convert 1 Column with a ton of data into several rows and columns
    By shirley16 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-01-2014, 03:47 PM
  6. Convert rows to columns based on values in a column
    By happy days in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-12-2012, 05:36 AM
  7. [SOLVED] convert 10,000 item column into 1,000 rows by 10 columns
    By McDuck in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-23-2006, 02:55 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