+ Reply to Thread
Results 1 to 4 of 4

repeated transposition of multiple columns to a row

  1. #1
    Registered User
    Join Date
    06-05-2009
    Location
    Chicago, Illinois
    MS-Off Ver
    Excel 2004 for Mac
    Posts
    2

    repeated transposition of multiple columns to a row

    Hello, I have been using Excel to store XY coordinate data for various specimens. Each specimen has 16 XY coordinates (see attached sample data), and thus far I have been using a single "X" and "Y" column. However, for further analysis in another program, I need to export the data with a single row per specimen.

    Currently, my data is in the format (total number of coordinates reduced for example):
    Specimen1 1 2
    Specimen1 3 4
    Specimen1 5 6
    Specimen2 1 2
    Specimen2 3 4
    Specimen2 5 6

    And I want it in the format:
    Specimen1 1 2 3 4 5 6
    Specimen2 1 2 3 4 5 6

    So I'm looking to shift over the xy data into xyxyxyxy(...) format, while deleting the extra specimen labels and blank space left behind between entries. I know very little of VBA programming--thus far I've been playing around with the TRANSPOSE function but with no luck. Any suggestions on how to do this?
    Attached Files Attached Files
    Last edited by mcgrath; 06-05-2009 at 08:27 PM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: repeated transposition of multiple columns to a row

    Welcome to the forum, mcgrath.

    Unless you particularly want a macro,

    In E2 and down =INDEX(A:A, 16* ROW() - 30)

    In F2, =INDEX($B:$C, 16 * ROW() - 31 + INT(COLUMNS($E2:F2)/2), MOD(COLUMNS($E2:F2), 2) + 1)

    Then copy that across to AK2, then copy down.

    Then you can replace all those formulas with values and delete columns A:D.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    06-05-2009
    Location
    Chicago, Illinois
    MS-Off Ver
    Excel 2004 for Mac
    Posts
    2

    Re: repeated transposition of multiple columns to a row

    Ah, that is working very well.

    Thank you so much!

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: repeated transposition of multiple columns to a row

    You're welcome. Would you please mark the thread as Solved? (How to ... in menu bar)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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