+ Reply to Thread
Results 1 to 27 of 27

Transpose data

  1. #1
    Registered User
    Join Date
    05-16-2014
    Location
    Pembroke, Malta
    MS-Off Ver
    Microsoft excel for Office 365 MSO (16.11727.20222) 32-bit
    Posts
    27

    Transpose data

    Hello,

    I have been assigned an urgent task this morning and would need some help.

    I have a huge table as show below;Attachment 633127

    I would like to amend asAttachment 633128

    I am actually placing the connection into a column and fill the correspondent details, buy using Index Match function =INDEX(FCB[depdesc],MATCH(1,(A3=FCB[code])*($D$2=FCB[source]),0) with CSE but since table contains about 150,000 row it's taking ages to complete.

    Any suggestion or ideas how I could speed and improve?

    Thanks in advance
    Attached Files Attached Files
    Last edited by Alba573; 07-19-2019 at 03:30 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,830

    Re: Transpose data

    Which version of Excel are you using?

    What exactly have you been tasked to do? What is the transposition?
    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
    Registered User
    Join Date
    05-16-2014
    Location
    Pembroke, Malta
    MS-Off Ver
    Microsoft excel for Office 365 MSO (16.11727.20222) 32-bit
    Posts
    27

    Re: Transpose data

    Good morning Ali,

    I'm using Excel version 1906.

    My task is to get distinct connections from column A from table 1, then I transposed as seen on table 2, and fill there correspondent department accordingly.

    Thanks,
    Stephen

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

    Re: Transpose data

    Will you please attach a SMALL sample Excel workbook (10-20 rows of data is usually enough)? However, please give us an indication of the approximate number of rows of data you want the solution to work with (100, 1000, 100,000 or whatever). Please don't attach a picture of an Excel sheet (no-one will want to re-type all your stuff before starting).

    1. It does NOT have to be your real sheet - mock up a SAMPLE if you need to. But not 1000's of rows!!! It makes manual checking so tedious. Whatever you do... make sure that all confidential information is removed first!!

    2. Make sure that your sample data are truly REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    3. Make sure that your desired solution is also shown (mock up the results manually).


    4. Try to avoid using merged cells. They cause lots of problems!

    Unfortunately the attachment icon doesn't work at the moment. So, to attach an Excel file you have to do the following: Just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.
    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

  5. #5
    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,830

    Re: Transpose data

    Could you please update your user profile to show your current Excel version? If 1906 is a Mac version, then add Mac, too.

  6. #6
    Registered User
    Join Date
    05-16-2014
    Location
    Pembroke, Malta
    MS-Off Ver
    Microsoft excel for Office 365 MSO (16.11727.20222) 32-bit
    Posts
    27

    Re: Transpose data

    Hi Ali,

    Did update my profile this is my excel version
    Microsoft excel for Office 365 MSO (16.11727.20222) 32-bit

  7. #7
    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,830

    Re: Transpose data

    OK - thanks. Office 365 would have been enough, since it's always up-to-date!

    Now for that workbook, please ...

  8. #8
    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,830

    Re: Transpose data

    Just seen the workbook - I cannot see the connection between the two tables. What is supposed to have happened? How does the one on the left relate to the one on the right?

  9. #9
    Registered User
    Join Date
    05-16-2014
    Location
    Pembroke, Malta
    MS-Off Ver
    Microsoft excel for Office 365 MSO (16.11727.20222) 32-bit
    Posts
    27

    Re: Transpose data

    Good morning Glenn,

    thanks for your reply, apologise for not uploading a sample file.. just uploaded now.

  10. #10
    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,053

    Re: Transpose data

    How on earth are you supposed to get from the table on the left to the table on the right?? They are completely different data. If you don't give us before/after data as requested in bold/red at post 4... were playing guessing games.

  11. #11
    Registered User
    Join Date
    05-16-2014
    Location
    Pembroke, Malta
    MS-Off Ver
    Microsoft excel for Office 365 MSO (16.11727.20222) 32-bit
    Posts
    27

    Re: Transpose data

    the right with green row is the raw data I received.

    The left the one with blue row is the one I'm working on.

    The connection column from the right table has been transposed in the left table (rows C2:E2) and then I'm using the index function as mentioned above to the get the departmentcode under the store name. Hope I explained well.

    Updated the sample file to understand better.

  12. #12
    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,830

    Re: Transpose data

    But the food items are completely different ... How do you get from Lyons Rich Tea to Tabasco Sauce? They aren't even the same type of foodstuff ...

    Your second sample is even more confusing.

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

    Re: Transpose data

    Gawd!! I'll have just one punt at this:

    =IFERROR(INDEX($J:$J,AGGREGATE(15,6,ROW($J$3:$J$11)/($G$3:$G$11=C$2),ROWS($1:1))),"")

    in C3, copied across and down. I don't play guessing games and you have not done what I asked for (twice) showing before/after data in a represwntative sample file.
    Attached Files Attached Files

  14. #14
    Registered User
    Join Date
    05-16-2014
    Location
    Pembroke, Malta
    MS-Off Ver
    Microsoft excel for Office 365 MSO (16.11727.20222) 32-bit
    Posts
    27

    Re: Transpose data

    Hi Ali,

    Thanks for your patience please see my sample file_2 maybe it's explained better.
    Attached Files Attached Files

  15. #15
    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,830

    Re: Transpose data

    You can use PowerQuery (Get & Transform on the Data ribbon). You can either load the table (as I did below) or load the source data directly from a workbook file without opening it first.

    M Code:

    Please Login or Register  to view this content.
    Result:

    Excel 2016 (Windows) 32 bit
    G
    H
    I
    J
    K
    13
    code desc1 PT St Venera PT Spinola PT St' Julians
    14
    072417075872 Lyons Rich Tea 300 grms FOOD CUPBOARD FOOD CUPBOARD FOOD CUPBOARD
    15
    3185205017590 Tipiak Mini Bouchees ( Vol-au-vent ) 14 FOOD CUPBOARD FOOD CUPBOARD FOOD CUPBOARD
    16
    3185205040109 Tipiak Bouchees Patissieres Vol Au Vent FOOD CUPBOARD FOOD CUPBOARD FOOD CUPBOARD
    17
    3245412563256 Carrefour Tortillas Messicana 8 pcs. FOOD CUPBOARD FOOD CUPBOARD
    18
    3262350211421 Forchy Raisins Cake 275 grms FOOD CUPBOARD FOOD CUPBOARD
    19
    4003587077805 Dan Cake Waffels 250 grms FOOD CUPBOARD FOOD CUPBOARD FOOD CUPBOARD
    20
    4007933454012 Delba Organic Rye Bread 500 grms FOOD CUPBOARD FOOD CUPBOARD FOOD CUPBOARD
    21
    4007933454029 Delba Organic Sunflower Seed Bread 500 g FOOD CUPBOARD FOOD CUPBOARD
    Sheet: Sheet1
    Attached Files Attached Files
    Last edited by AliGW; 07-19-2019 at 04:04 AM.

  16. #16
    Registered User
    Join Date
    05-16-2014
    Location
    Pembroke, Malta
    MS-Off Ver
    Microsoft excel for Office 365 MSO (16.11727.20222) 32-bit
    Posts
    27

    Re: Transpose data

    Will try out in 30 minutes as I'm in between meetings.

    Thanks a million.

  17. #17
    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,830

    Re: Transpose data

    Are you addressing me or Glenn?

  18. #18
    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,053

    Re: Transpose data

    Ignore my previous formula...

    In I4, copied across and down:

    =IFERROR(INDEX($D$4:$D$24,INDEX(MATCH($G4&I$3,$B$4:$B$24&$A$4:$A$24,0),0)),"")
    Attached Files Attached Files

  19. #19
    Registered User
    Join Date
    05-16-2014
    Location
    Pembroke, Malta
    MS-Off Ver
    Microsoft excel for Office 365 MSO (16.11727.20222) 32-bit
    Posts
    27
    Quote Originally Posted by AliGW View Post
    Are you addressing me or Glenn?
    Sorry Ali yes I was addressing you.🙏

  20. #20
    Registered User
    Join Date
    05-16-2014
    Location
    Pembroke, Malta
    MS-Off Ver
    Microsoft excel for Office 365 MSO (16.11727.20222) 32-bit
    Posts
    27
    Quote Originally Posted by Glenn Kennedy View Post
    Ignore my previous formula...

    In I4, copied across and down:

    =IFERROR(INDEX($D$4:$D$24,INDEX(MATCH($G4&I$3,$B$4:$B$24&$A$4:$A$24,0),0)),"")
    Thanks Glenn, will also try and update you.

  21. #21
    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,830

    Re: Transpose data

    I thought you said that formulae were slowing you down?

  22. #22
    Registered User
    Join Date
    05-16-2014
    Location
    Pembroke, Malta
    MS-Off Ver
    Microsoft excel for Office 365 MSO (16.11727.20222) 32-bit
    Posts
    27

    Re: Transpose data

    Hi Ali,

    Did try your suggestion and works like a charm, well done.

    One question if i have other columns to unpivot such as catdesc as on my sample file, would it be possible to do with powerquey?

    As per attached sample.

    Thanks,

    Stephen
    Attached Files Attached Files

  23. #23
    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,830

    Re: Transpose data

    I'll have a look and let you know.

  24. #24
    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,830

    Re: Transpose data

    Yes - pivot each category separately and then merge the queries - results on sheet 3 of the attached.

  25. #25
    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,830

    Re: Transpose data

    Did this work for you?

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  26. #26
    Registered User
    Join Date
    05-16-2014
    Location
    Pembroke, Malta
    MS-Off Ver
    Microsoft excel for Office 365 MSO (16.11727.20222) 32-bit
    Posts
    27

    Re: Transpose data

    Hi Ali,

    Many thanks for your help and ideas, besides solving my query I have manged to improve more my power query skills with your solutions.

    Thank you once again, for your time and patience, keep up all your good work.

    Stephen

  27. #27
    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,830

    Re: Transpose data

    Thanks for letting us know - glad to have helped.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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: 4
    Last Post: 08-21-2018, 09:24 AM
  2. transpose column to a range calculate and transpose to new table loop
    By moshro1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-02-2015, 10:52 AM
  3. Replies: 7
    Last Post: 10-03-2014, 05:04 AM
  4. Transpose Data from Columns to Rows after each unique data point
    By lnagell in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-01-2014, 08:10 PM
  5. Transpose data to columns from rows keeping unique data together
    By aimeecrystalaid in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-09-2013, 12:23 AM
  6. [SOLVED] Transpose: How can I copy a list and transpose it but leaving 3 cells in between each item
    By cocolete in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-11-2012, 10:01 AM
  7. Replies: 2
    Last Post: 02-19-2007, 04:53 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