+ Reply to Thread
Results 1 to 11 of 11

Transpose Problem

  1. #1
    Forum Contributor
    Join Date
    06-16-2008
    Posts
    115

    Transpose Problem

    Hello Excel Experts,

    I need to figure out a way to transpose several columns in 2 columns. The big hangup for me is the Address column (see link to Google sheet below. The value in the group in the Address column now only appears once, but it will need to be repeated in the desired layout.

    Link to Sheet: https://docs.google.com/spreadsheets...it?usp=sharing

    I'm not sure about whether there is a function that can be worked out or if I need VBA.

    All feedback would be greatly appreciated.

    Thanks!
    Attached Files Attached Files
    Last edited by newbieexceldude; 12-17-2016 at 04:17 AM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    MS 365 Subscription Insider (Windows 10)
    Posts
    51,087

    Re: Transpose Problem

    Will you please attach a sample Excel workbook? Some members are unable or unwilling to access file-sharing sites.

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

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

    3. Make sure that all confidential data is removed or replaced with dummy data first (e.g. names, addresses, E-mails, etc.).

    4. Try to avoid using merged cells as 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.

    Please pay particular attention to point 2 (above): without an idea of your intended outcomes, it is often very difficult to offer appropriate advice.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!

    Forum Rules (updated September 2018): please read them here.
    How to use the Power Query code you've been given: help here. More about the Power suite here.
    Don't forget to say "thank you" to those who have helped you in your thread. If you wish, you can also reward them by clicking on their reputation star bottom left.

  3. #3
    Forum Contributor
    Join Date
    06-16-2008
    Posts
    115

    Re: Transpose Problem

    Thanks. The file is now attached.

  4. #4
    Forum Contributor
    Join Date
    06-16-2008
    Posts
    115

    Re: Transpose Problem

    Is there a way for this to be done with a pivot table?

  5. #5
    Forum Expert azumi's Avatar
    Join Date
    12-10-2012
    Location
    YK, Indonesia
    MS-Off Ver
    Excel 2010
    Posts
    2,249

    Re: Transpose Problem

    For Address
    =IFERROR(INDEX($A$5:$A$29,INT(SMALL(IF($B$5:$I$29<>"",(ROW($B$5:$I$29)-ROW($B$5)+1)*10^5+COLUMN($B$5:$I$29)-COLUMN($B$5)+1),ROWS($A$1:A1))/10^5)),"")

    For COlumn
    =IFERROR(INDEX($B$5:$I$29,SMALL(IF(($A$5:$A$29=$A34)*($B$5:$I$29<>""),MATCH(ROW($B$5:$I$29),ROW($B$5:$I$29)),""),COUNTIF($A$34:A34,A34)),1*(SMALL(IF(($A$5:$A$29=$A34)*($B$5:$I$29<>""),MATCH(ROW($B$5:$I$29),ROW($B$5:$I$29))+1*MATCH(COLUMN($B$5:$I$29),COLUMN($B$5:$I$29)),""),COUNTIF($A$34:A34,A34))-SMALL(IF(($A$5:$A$29=$A34)*($B$5:$I$29<>""),MATCH(ROW($B$5:$I$29),ROW($B$5:$I$29)),""),COUNTIF($A$34:A34,A34)))),"")

    all is array formula
    Attached Files Attached Files

  6. #6
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    11,471

    Re: Transpose Problem

    Excel VBA:

    Please Login or Register  to view this content.
    Ben Van Johnson

  7. #7
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    15,484

    Re: Transpose Problem

    Hi Newbie,

    Power Query, which is built into Excel 2016 takes no code and can*do this problem in about 10 mouse clicks and no VBA.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  8. #8
    Forum Contributor
    Join Date
    06-16-2008
    Posts
    115

    Re: Transpose Problem

    Hi protonLeah,

    This is outstanding work! THANK YOU.

    I've tested the macro on 5 different data sets and it worked perfectly for 4 othem. I think the problem with the 5th one is the Xpath (data scraping) got jacked up, and it's not a problem with the macro.

    Thanks again. I really appreciate it.

  9. #9
    Forum Contributor
    Join Date
    06-16-2008
    Posts
    115

    Re: Transpose Problem

    Please share, MarvinP. I only understand the very basics of Power Query.

  10. #10
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    15,484

    Re: Transpose Problem

    Hi newbie,

    My Edge browser and the Excel Forum are not*getting along this evening, otherwise I would have posted my file last post. See an example*of UnPivot at:

    http://www.excelguru.ca/blog/2013/11...n-power-query/

    BTW - you need to have 2016 excel or if you have 20120 or 2013, you need to install the power query add-in.

  11. #11
    Forum Contributor
    Join Date
    06-16-2008
    Posts
    115

    Re: Transpose Problem

    Thanks a lot, MarvinP. I'll see if I can figure this out.

+ 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] Problem with transpose
    By kuntalnr in forum Excel General
    Replies: 8
    Last Post: 11-14-2013, 10:32 AM
  2. Problem in Split and Transpose
    By chiragsinghal4 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-19-2012, 10:37 AM
  3. Copy and Transpose Problem
    By SimonDorfman in forum Excel General
    Replies: 2
    Last Post: 12-22-2011, 01:43 PM
  4. excel transpose problem
    By Lojikal in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-09-2010, 02:26 AM
  5. problem with worksheetfunction.transpose
    By ramserp in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-17-2009, 08:11 AM
  6. Not exactly a transpose problem
    By Wibs in forum Excel General
    Replies: 5
    Last Post: 06-15-2006, 06:49 AM
  7. [SOLVED] Transpose Problem
    By Biman in forum Excel General
    Replies: 8
    Last Post: 01-13-2005, 10:06 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