+ Reply to Thread
Results 1 to 7 of 7

Need to Transpose and Flip Table of Data - Macro Probably Needed

  1. #1
    Registered User
    Join Date
    02-06-2013
    Location
    Cincinnati, Ohio
    MS-Off Ver
    Excel 2007
    Posts
    6

    Need to Transpose and Flip Table of Data - Macro Probably Needed

    Hello All,

    I am a longtime user of excelforum, but I haven't thought about posting until now. I'm hoping you can help with an issue I'm having.

    On a monthly basis I receive a table of data that has 24 rows and columns. Once I receive it, I manually transpose and flip the columns and rows. My hope is that one of the VBA superstars on the forum can write a macro to do this automatically. I have attached a workbook that shows the before (how I receive the data) and after (how I'd like it to look after using a macro). It's hard to explain without looking at the workbook, but normal transpose functions don't seem to work here.

    Any help would be greatly appreciated!

    Best,
    Bob
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    02-06-2013
    Location
    Cincinnati, Ohio
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Need to Transpose and Flip Table of Data - Macro Probably Needed

    Can anyone help with this issue?

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,050

    Re: Need to Transpose and Flip Table of Data - Macro Probably Needed

    Hi and welcome to the forum

    This isnt VBA, but will do the job jut as well...

    =IF(INDEX($C$2:$AA$26,MATCH($C32,$C$2:$C$26,0),MATCH(D$31,$C$2:$AA$2,0))=0,"",INDEX($C$2:$AA$26,MATCH($C32,$C$2:$C$26,0),MATCH(D$31,$C$2:$AA$2,0)))

    copied down and across
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,050

    Re: Need to Transpose and Flip Table of Data - Macro Probably Needed

    deleted duplicate post

  5. #5
    Registered User
    Join Date
    02-06-2013
    Location
    Cincinnati, Ohio
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Need to Transpose and Flip Table of Data - Macro Probably Needed

    Wow! That works really well. Thank you so much.

    Is it possible to modify the formula to include the dates as well? It seems this formula uses the dates in the "Before" and "After" table as the reference points. If there were to be no dates, is it still possible for it the formula to work?

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,050

    Re: Need to Transpose and Flip Table of Data - Macro Probably Needed

    Sure, change the formula to...
    =IF(INDEX($C$2:$AA$26,COLUMN(A1)+1,ROW(A1)+1)=0,"",INDEX($C$2:$AA$26,COLUMN(A1)+1,ROW(A1)+1))


    NOTE however, this is for a table that starts exactly where yours does. If it starts further to the right, increase the COLUMN(A1)+1 part, if it starts lower down, adjust the ROW(A1)+1 part
    a simplified version would be...
    =IF(INDEX($C$2:$AA$26,COLUMN(B1),ROW(A2))=0,"",INDEX($C$2:$AA$26,COLUMN(B1),ROW(A2)))

  7. #7
    Registered User
    Join Date
    02-06-2013
    Location
    Cincinnati, Ohio
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Need to Transpose and Flip Table of Data - Macro Probably Needed

    Thank you very much! This is exactly what I needed.

+ 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