+ Reply to Thread
Results 1 to 11 of 11

Transposing a large "ladder" shape matrix

  1. #1
    Registered User
    Join Date
    12-08-2020
    Location
    Hong Kong
    MS-Off Ver
    365
    Posts
    4

    Unhappy Transposing a large "ladder" shape matrix

    Hi

    I have a matrix with a 3000*3000 "ladder" shape matrix

    I would like to transpose it and retain the original value without overlapping
    (i.e. a2=b1, a3=c1, b3=c2 ......)

    Then I would like to add value in the border cell after transpose

    How could I do it in a fast way?

    (I could not do it one by one since it is a very large matrix and it is time consuming)

    Thank you for your time reading this post.

    Any suggestions would be appreciated

    Illustrations is stated in the picture below as the post could not recognise space properly:
    Last edited by s2031015; 12-08-2020 at 04:24 AM.

  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. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,829

    Re: Transposing a large "ladder" shape matrix

    Welcome to the forum.

    There are instructions at the top of the page explaining how to attach your sample workbook.
    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
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: Transposing a large "ladder" shape matrix

    Do you run out of memory copying, doing paste special transpose, skip blanks?

    then find and select, Got to special, slect blanks and make 100?


    Failing this you will need a vba approach to the solution

  4. #4
    Registered User
    Join Date
    12-08-2020
    Location
    Hong Kong
    MS-Off Ver
    365
    Posts
    4

    Re: Transposing a large "ladder" shape matrix

    I am not sure what is an out of memory copying?

    When I select all the cells with normal square targeting, paste transpose does not work since it would overlap the original data

    Quote Originally Posted by davsth View Post
    Do you run out of memory copying, doing paste special transpose, skip blanks?

    then find and select, Got to special, slect blanks and make 100?


    Failing this you will need a vba approach to the solution

  5. #5
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: Transposing a large "ladder" shape matrix

    My mistake firstly, make a copy of the original sheet, as excel does not like copy and paste ranges to overlap, unless they are an exact match

    copy the data, then go to paste special. you may need to look at the options at the bottom of the box, i do not have your version of excel, but there are 2 tick boxes for transpose and skip blanks slect both

    the key statement is selecting the skip blanks box alongside paste special transpose. As the blocks you are transposing are blank in these cells they will not overwrite

    As it was a large amount of data, i was wondering if there might be an issue copying and pasting, it depends on your PC configuration

  6. #6
    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,050

    Re: Transposing a large "ladder" shape matrix

    Here's a formula-based solution. I moved your grid slightly. There MUST be a blank row above the source data:

    =IF(OR(ROWS($3:3)>ROWS($A$3:$E$7)+1,COLUMNS($H:H)>COLUMNS($A$3:$E$7)+1),"",IFERROR(1/(1/(OFFSET($A$3,ROWS($3:3)-2,COLUMNS($A:A)-1)+OFFSET($A$3,COLUMNS($A:A)-2,ROWS($3:3)-1))),100))
    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.

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

  7. #7
    Forum Contributor
    Join Date
    08-26-2016
    Location
    UK
    MS-Off Ver
    O365
    Posts
    260

    Re: Transposing a large "ladder" shape matrix

    The attached just automates davsth's recommendations.
    Select the area to be processed thus:
    2020-12-08_113642.png
    [I don't know why this picture isn't showing, but clicking it will show it]
    then click the button.
    It runs this macro:
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by p45cal; 12-08-2020 at 01:19 PM.

  8. #8
    Registered User
    Join Date
    12-08-2020
    Location
    Hong Kong
    MS-Off Ver
    365
    Posts
    4

    Re: Transposing a large "ladder" shape matrix

    How could this formula apply to the large matrix that I had?

  9. #9
    Registered User
    Join Date
    12-08-2020
    Location
    Hong Kong
    MS-Off Ver
    365
    Posts
    4

    Re: Transposing a large "ladder" shape matrix

    How could I apply this macro to my own original data?

    Quote Originally Posted by p45cal View Post
    The attached just automates davsth's recommendations.
    Select the area to be processed thus:
    Attachment 707780
    [I don't know why this picture isn't showing, but clicking it will show it]
    then click the button.
    It runs this macro:
    Please Login or Register  to view this content.

  10. #10
    Forum Contributor
    Join Date
    08-26-2016
    Location
    UK
    MS-Off Ver
    O365
    Posts
    260

    Re: Transposing a large "ladder" shape matrix

    Quote Originally Posted by s2031015 View Post
    How could I apply this macro to my own original data?
    Select the existing data as shown in the picture in msg#7, then run the macro. It will add the 'reflected' data to your existing data and you must ensure that there's at least 1 spare row above your selection.

  11. #11
    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,050

    Re: Transposing a large "ladder" shape matrix

    Quote Originally Posted by s2031015 View Post
    How could this formula apply to the large matrix that I had?
    If you're talking to me... yes.

+ 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. Replies: 2
    Last Post: 04-24-2020, 02:41 AM
  2. [SOLVED] Large data base with a "1" after address & it should be "st"
    By pick44 in forum Excel General
    Replies: 3
    Last Post: 09-02-2017, 01:20 PM
  3. [SOLVED] Nesting "IF" with "Match" and "Large"
    By sherman51 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 07-22-2016, 07:58 AM
  4. Replies: 2
    Last Post: 06-25-2013, 12:43 PM
  5. [SOLVED] How to extract "large" and "small" amounts from vlookup
    By okjeep in forum Excel General
    Replies: 14
    Last Post: 05-02-2012, 06:28 AM
  6. [SOLVED] Find multiple "text" criteria and return as ""Yes" in Matrix
    By bertrand82 in forum Excel General
    Replies: 11
    Last Post: 04-30-2012, 09:20 AM
  7. [SOLVED] Utility to "clean up" or "defrag" large Excel file
    By Sabrina in forum Excel General
    Replies: 3
    Last Post: 01-12-2006, 06:00 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