+ Reply to Thread
Results 1 to 16 of 16

Converting rows to columns

  1. #1
    Registered User
    Join Date
    02-07-2023
    Location
    London
    MS-Off Ver
    MS365 version 2205
    Posts
    3

    Converting rows to columns

    Hi all, our IT department has been stumped by this - we need to convert a report from multiple rows for each client representing different services to one row for each client with the services in columns as per the attached. Any ideas ?
    Attached Files Attached Files

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

    Re: Converting rows to columns

    Hi. Before we get going on this one...

    Is your forum profile showing the Excel PRODUCT that you need this request to work with?

    The best solutions often rely on knowing WHICH Office PRODUCT (Excel, NOT Windows) that you have. Please check that your forum profile is up-to-date. If you aren't sure, in Excel go to File/Account and report what it says below the MS logo at the top of that page. If your version is for Mac, please also state this.

    The three most recent Excel PRODUCTS are Excel 2019, Excel 2021 and MS365 - if you are using MS365, please give this name along with the Version number in your profile (e.g. MS365 (PC) Version 2211). The version number is in the About Excel section further down the Account page.

    Cheers,

    Glenn.
    Attached Images Attached Images
    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.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,207

    Re: Converting rows to columns

    Please update your Excel version/release [64 is not one!!!] as answers do depend on knowing this information
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  4. #4
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.84 (24041420))
    Posts
    8,751

    Re: Converting rows to columns

    Edit - answers given while i was creating the example spreadsheet

    EDIT - JohnTopley - correction in later post - also updated the spreadsheet

    how about using
    =IF(COUNTIFS($A$2:$A$15,$E2,$B$2:$B$15,F$1),F$1,"")

    Not sure which version of excel you have - but this uses transpose & unique
    otherwise the table headings can just be setup manually
    Attached Files Attached Files
    Last edited by etaf; 02-07-2023 at 07:14 AM.
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  5. #5
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,207

    Re: Converting rows to columns

    Minor correction

    =IF(COUNTIFS($A$2:$A$15,$E2,$B$2:$B$15,F$1),F$1,"")

  6. #6
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.84 (24041420))
    Posts
    8,751

    Re: Converting rows to columns

    thanks JohnTopley
    I have updated the post and spreadsheet to reflect your correction
    thanks again
    Last edited by etaf; 02-07-2023 at 07:14 AM.

  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 2403
    Posts
    44,054

    Re: Converting rows to columns

    If you have the latest version of O365, you can do the lot in a single cell, using:

    =LET(A,'Current data'!A2:A15,B,'Current data'!B2:B15,C,UNIQUE(A),D,TRANSPOSE(UNIQUE('Current data'!B2:B15,FALSE)),E,DROP(REDUCE("",D,LAMBDA(y,z,HSTACK(y,BYROW(C,LAMBDA(x,IFERROR(IF(MATCH(1,(A=x)*(B=z),0)>0,z,""),"")))))),,1),VSTACK(HSTACK("",D),HSTACK(C,E)))
    Attached Files Attached Files

  8. #8
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Cool Re: Converting rows to columns

    with Power Query

    Client Service Client a b c d e f g
    Client 1 Service a Client 1 Service a Service b Service c Service d Service e
    Client 1 Service b Client 2 Service a Service c Service d Service f Service g
    Client 1 Service c Client 3 Service c
    Client 1 Service d Client 4 Service c Service d Service f
    Client 1 Service e
    Client 2 Service a
    Client 2 Service c
    Client 2 Service d
    Client 2 Service f
    Client 2 Service g
    Client 3 Service c
    Client 4 Service c
    Client 4 Service d
    Client 4 Service f


    you have redundant spaces in the source table
    Attached Files Attached Files
    Last edited by sandy666; 02-07-2023 at 07:32 AM.

  9. #9
    Registered User
    Join Date
    02-07-2023
    Location
    London
    MS-Off Ver
    MS365 version 2205
    Posts
    3

    Re: Converting rows to columns

    Sorry - it's MS365 and version 2205.

  10. #10
    Registered User
    Join Date
    02-07-2023
    Location
    London
    MS-Off Ver
    MS365 version 2205
    Posts
    3

    Re: Converting rows to columns

    Quote Originally Posted by sandy666 View Post
    with Power Query

    Client Service Client a b c d e f g
    Client 1 Service a Client 1 Service a Service b Service c Service d Service e
    Client 1 Service b Client 2 Service a Service c Service d Service f Service g
    Client 1 Service c Client 3 Service c
    Client 1 Service d Client 4 Service c Service d Service f
    Client 1 Service e
    Client 2 Service a
    Client 2 Service c
    Client 2 Service d
    Client 2 Service f
    Client 2 Service g
    Client 3 Service c
    Client 4 Service c
    Client 4 Service d
    Client 4 Service f


    you have redundant spaces in the source table
    What we actually wanted was a "Yes" or tick rather than the actual service description for each client (and the service description just at the top of the relevant column) but I assumed we would need to go with the data that was already there and have the service description written out in each cell as it was originally.

  11. #11
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.84 (24041420))
    Posts
    8,751

    Re: Converting rows to columns

    What we actually wanted was a "Yes" or tick rather than the actual service description for each client
    Thats not what your "required data" showed

    =IF(COUNTIFS($A$2:$A$15,$E2,$B$2:$B$15,F$1),"Yes","")

    many years ago, I made an attendance tracker and used marlett font with an lowercase "a" to get a tick
    =IF(COUNTIFS($A$2:$A$15,$E2,$B$2:$B$15,F$1),"a","")
    Attached Files Attached Files
    Last edited by etaf; 02-07-2023 at 08:55 AM.

  12. #12
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Converting rows to columns

    Quote Originally Posted by mahutchinson View Post
    What we actually wanted was a "Yes" or tick rather than the actual service description for each client (and the service description just at the top of the relevant column) but I assumed we would need to go with the data that was already there and have the service description written out in each cell as it was originally.
    solution was tailored to your example, I didn't see there any requirement different than I posted

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

    Re: Converting rows to columns

    Please upload a sample sheet showing what you DO want... not what you DO NOT want.

  14. #14
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Converting rows to columns

    ... and DON'T QUOTE WHOLE POST but required part of text only

  15. #15
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Cool Re: Converting rows to columns

    Quote Originally Posted by mahutchinson View Post
    What we actually wanted was a "Yes" or tick rather than the actual service description for each client (and the service description just at the top of the relevant column)
    tick.png

    unfortunately the forum doesn't recognize the tick (square root) symbol and that's why there is a picture
    Attached Files Attached Files
    Last edited by sandy666; 02-07-2023 at 10:08 AM.

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

    Re: Converting rows to columns

    Formulae (3) to produce column and row headers and result.
    Attached Files Attached Files

+ 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. Converting Rows to Columns
    By ahoneycutt in forum Excel General
    Replies: 8
    Last Post: 09-08-2016, 01:46 PM
  2. Converting rows to columns and adding extra rows as required
    By teco in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-09-2016, 04:18 PM
  3. Converting multiple columns to rows / Converting to Panel Data
    By Stuart11 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-14-2013, 05:50 AM
  4. Converting columns to rows for multiple rows
    By khscruz in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-04-2011, 11:59 AM
  5. (Again) Converting rows to columns
    By nickr1954 in forum Excel General
    Replies: 4
    Last Post: 01-28-2006, 09:25 AM
  6. Re: (Again) Converting rows to columns
    By Barb Reinhardt in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-27-2006, 06:45 PM
  7. Converting rows to columns
    By eylul in forum Excel General
    Replies: 1
    Last Post: 04-14-2005, 10:52 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