+ Reply to Thread
Results 1 to 2 of 2

Convert a portion of data from horizontal to vertical but not all (cant use transpose)

  1. #1
    Registered User
    Join Date
    10-02-2012
    Location
    somewhere
    MS-Off Ver
    Excel 2010
    Posts
    1

    Convert a portion of data from horizontal to vertical but not all (cant use transpose)

    Hi There,
    Need help on a shortcut to convert a set of data from a mix of vertical/horizontal, to all vertical. Need the one numeric metric and time values to be vertical. See example of my issue below. Transpose doesn't do exactly what I need so looking for functions/VBA ideas. Thanks!!

    Prouduct Sales Type Wk 1 Wk 2 Wk 3 Wk 4 Wk 5
    Product 1 Commercial 1 2 3 4 5
    Product 2 Commerical 1 2 3 4 5
    Product 3 Consumer 1 2 3 4 5

    Prouduct Sales Type Week Sales
    Product 1 Commercial Wk 1 1
    Product 1 Commercial Wk 2 2
    Product 1 Commercial Wk 3 3
    Product 1 Commercial Wk 4 4
    Product 1 Commercial Wk 5 5
    Product 2 Commercial Wk 1 1
    Product 2 Commercial Wk 2 2
    Product 2 Commercial Wk 3 3
    Product 2 Commercial Wk 4 4
    Product 2 Commercial Wk 5 5
    Product 3 Consumer Wk 1 1
    Product 3 Consumer Wk 2 2
    Product 3 Consumer Wk 3 3
    Product 3 Consumer Wk 4 4
    Product 3 Consumer Wk 5 5

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Convert a portion of data from horizontal to vertical but not all (cant use transpose)

    Somewhere else on Spreadsheet (I started in K2)

    For Product
    =IFERROR(INDEX($A$2:$A$4,INT((ROW(A1)-1)/5)+1),"") Used 5 because your example has 5 weeks, modify as needed

    For Sale Type
    =IFERROR(INDEX($B$2:$B$4,INT((ROW(A1)-1)/5)+1),"")

    For Week Number
    =IF(LEN(L2)>1,"Wk "&MOD((ROW(A1)-1),5)+1,"")

    For Quantity or value
    =IFERROR(INDEX($C$2:$G$4, INT((ROW(A1)-1)/5)+1,MATCH(M2,$C$1:$G$1,0)),"")
    Questions? See attachment
    Attached Files Attached Files
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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