+ Reply to Thread
Results 1 to 12 of 12

Transpose horizontal to vertical

  1. #1
    Registered User
    Join Date
    07-01-2010
    Location
    Luxembourg, Luxembourg
    MS-Off Ver
    Excel 2019
    Posts
    80

    Transpose horizontal to vertical

    Hi,

    I have a list with 9 different persons (A2:A10) and each person has 7 different areas in column B to H

    Now I want to have the horizontal areas transposed vertically in one column and showing for each area the name of the person in charge.

    Many thanks in advance
    Attached Files Attached Files

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

    Re: Transpose horizontal to vertical

    You could put this formula (say in K2):

    =INDEX(A:A,INT((ROWS($1:1)-1)/7)+2)

    and this one in L2:

    =INDEX(B:H,INT((ROWS($1:1)-1)/7)+2,MOD(ROWS($1:1)-1,7)+1)

    Note that you may need to use semicolons ( ; ) instead of commas ( , ) in the formulae, depending on your regional settings. Then you can copy the formulae down as far as you need them.

    Hope this helps.

    Pete

  3. #3
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: Transpose horizontal to vertical

    If the Areas are really numbers then you could retrieve them using SMALL like this in J2 downwards:

    Please Login or Register  to view this content.
    If they could be non-numeric then you might need something like this:

    Please Login or Register  to view this content.
    then K2 becomes:

    Please Login or Register  to view this content.
    See attached.

    WBD
    Attached Files Attached Files
    Office 365 on Windows 11, looking for rep!

  4. #4
    Registered User
    Join Date
    07-01-2010
    Location
    Luxembourg, Luxembourg
    MS-Off Ver
    Excel 2019
    Posts
    80

    Re: Transpose horizontal to vertical

    Many thanks, that's what I was looking for!!!

    What if, for any reason, the number of areas is not 7 but between 1 and 7?

    Many thanks for this

  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,737

    Re: Transpose horizontal to vertical

    Do you mean a variable number for each name, or a fixed number for all names (which might vary from 1 to 7)? It would be better to attach a new file illustrating your new requirements.

    Pete

  6. #6
    Registered User
    Join Date
    07-01-2010
    Location
    Luxembourg, Luxembourg
    MS-Off Ver
    Excel 2019
    Posts
    80

    Re: Transpose horizontal to vertical

    Names are unique and areas could be variable from 1 to 7
    Attached Files Attached Files

  7. #7
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,895

    Re: Transpose horizontal to vertical

    An alternative solution is with Power Query

    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.
    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

  8. #8
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: Transpose horizontal to vertical

    Are areas always numeric? If they are then see attached.

    WBD
    Attached Files Attached Files
    Last edited by WideBoyDixon; 11-12-2021 at 10:55 AM.

  9. #9
    Registered User
    Join Date
    07-01-2010
    Location
    Luxembourg, Luxembourg
    MS-Off Ver
    Excel 2019
    Posts
    80

    Re: Transpose horizontal to vertical

    Areas are always numeric

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

    Re: Transpose horizontal to vertical

    I've used a different approach, with helper columns in J and K with these formulae:

    J2: =COUNT(B2:H2)

    K2: =J2+K1

    and with zero in K1 (important). These two formulae count the number of records for each name in column J, and column K just gives a cumulative count.

    Then I've used these formulae:

    M2: =INDEX(A:A,MATCH(ROWS($1:1)-1,K:K)+1)

    N2: =INDEX($B$2:$H$10,MATCH(ROWS($1:1)-1,K:K),MATCH(ROWS($1:1)-1,K:K)+COUNTIF(M$2:M2,M2)-MATCH(M2,A:A,0)+1)

    N2 has a Custom Format of 000, and then the formulae in M2:N2 are copied down to give the complete set of data.

    Hope this helps.

    Pete

    EDIT: Sorry for the delay - I had a long phone call mid-way through.
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    07-01-2010
    Location
    Luxembourg, Luxembourg
    MS-Off Ver
    Excel 2019
    Posts
    80

    Re: Transpose horizontal to vertical

    Perfect aaa+++

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

    Re: Transpose horizontal to vertical

    You have had a number of people helping you, so it is not clear to whom you are addressing your comment, but thanks for marking the thread as Solved.

    You might also 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] transpose last row from horizontal to vertical
    By JACK JOUSH in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-10-2021, 09:04 AM
  2. [SOLVED] Transpose Horizontal to Vertical - one condition
    By ionelz in forum Excel General
    Replies: 4
    Last Post: 10-11-2020, 04:21 PM
  3. Transpose vertical data to horizontal
    By PeterKeown in forum Excel General
    Replies: 6
    Last Post: 08-03-2018, 05:51 AM
  4. Replies: 4
    Last Post: 09-04-2013, 12:42 PM
  5. Transpose Vertical Data to Horizontal
    By Randu555 in forum Excel General
    Replies: 5
    Last Post: 04-18-2013, 05:05 PM
  6. [SOLVED] Transpose Horizontal to Vertical with ID Column
    By galaxycoff in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-04-2012, 10:16 PM
  7. [SOLVED] convert vertical to horizontal (without Transpose)
    By timtim89 in forum Excel General
    Replies: 6
    Last Post: 03-28-2012, 10:50 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