+ Reply to Thread
Results 1 to 4 of 4

Horizontal data into vertical (repeatedly)

  1. #1
    Registered User
    Join Date
    03-03-2020
    Location
    PK
    MS-Off Ver
    MS Office 365
    Posts
    56

    Horizontal data into vertical (repeatedly)

    I have this data where you can see that against a S.No, there are amounts for 12 months. I want this data to be sorted in a way where against each S. No, there are 12 months (each) shown in vertical format with its respective figures. The final data should look like the data in the second tab but for each S. No.

    Unfortunately, I'm unable to find something like this even on Google and I don't know VBA Coding so I can't use that option either. There's a total of 192 serial numbers so doing this manually is also not an option.

    If anyone could tell me how to do it, that will be helpful.
    Attached Files Attached Files

  2. #2
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: Horizontal data into vertical (repeatedly)

    assuming what you have in the "final sample" tab are the cells filled in like cells A2 and B2, you can put this in C2 and drag down...
    =SUMPRODUCT((Combine!$A$2:$A$193='Final Sample'!A2)*(Combine!$B$1:$M$1='Final Sample'!B2),Combine!$B$2:$M$193)
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  3. #3
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Horizontal data into vertical (repeatedly)

    Please try at
    A2
    =INT((ROWS(A$2:A2)-1)/12)+1

    B2
    =INDEX(Combine!$B$1:$M$1,MOD(ROWS(B$2:B2)-1,12)+1)

    C2
    =INDEX(Combine!$B$2:$M$193,A2,MOD(ROWS(B$2:B2)-1,12)+1)

    or Power Query
    select combine sheet > Ribbon > Data > New Query > From table
    Advanced editor > paste below code

    Please Login or Register  to view this content.
    Open Power Query/Get and Transform. Click on New Query.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    03-03-2020
    Location
    PK
    MS-Off Ver
    MS Office 365
    Posts
    56

    Re: Horizontal data into vertical (repeatedly)

    Thank you so muchhhhh! The function part above worked! Thanks a lot man!
    Last edited by zainmerchant; 09-10-2020 at 03:01 PM.

+ 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: 16
    Last Post: 06-01-2017, 06:01 PM
  2. Horizontal Data to Vertical
    By mmagnin in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 01-18-2014, 12:45 AM
  3. [SOLVED] Horizontal data in vertical
    By ashfaquebwd in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-10-2013, 03:50 AM
  4. convert data horizontal to vertical
    By vorabha in forum Excel General
    Replies: 8
    Last Post: 02-10-2013, 03:53 PM
  5. Vertical to Horizontal data help!
    By hbrown78 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-05-2012, 09:57 PM
  6. [SOLVED] Data horizontal to vertical
    By sureshpunna in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 11-27-2012, 03:36 AM
  7. [SOLVED] Vertical to Horizontal data
    By trosasco in forum Excel General
    Replies: 5
    Last Post: 06-15-2012, 08:48 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