+ Reply to Thread
Results 1 to 4 of 4

Re-arrange data from vertical to horizontal

  1. #1
    Registered User
    Join Date
    06-17-2015
    Location
    London
    MS-Off Ver
    MS 10
    Posts
    7

    Re-arrange data from vertical to horizontal

    Can someone point me to the right direction please?

    Attached is my data. I need to show a product and the all the region in the same row. Is there a way to do that? I even consider to concatenate all regions in a single cell.

    My workbook has a few thousand line. This is only an example.


    Thanks,
    Attached Files Attached Files

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,762

    Re: Re-arrange data from vertical to horizontal

    I suggest you use a helper column for this, so put this formula in C3:

    =IF(A3="","-",A3&"_"&COUNTIF(A$3:A3,A3))

    then copy it down beyond your data (the hyphens will indicate this). Then, with your products listed from F3 downwards, you can put this formula in G3:

    =IFERROR(INDEX($B:$B,MATCH($F3&"_"&COLUMNS($G:G),$C:$C,0)),"")

    Copy this across and down as required. The attached file (Sheet1) demonstrates this.

    If it is not easy for you to supply the list of products, then you can derive them with the use of another helper column - put this formula in D3:

    =IF(A3="","-",IF(RIGHT(C3,2)="_1",MAX(D$2:D2)+1,""))

    and copy this down beyond your data, as indicated by the hyphens. Then you can use this formula in F3:

    =IFERROR(INDEX(A:A,MATCH(ROWS($1:1),D:D,0)),"")

    Which can be copied down as far as you need it (or beyond, to accommodate more data in future). This approach is shown in Sheet2 of the attached file.

    Hope this helps.

    Pete
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    06-17-2015
    Location
    London
    MS-Off Ver
    MS 10
    Posts
    7

    Re: Re-arrange data from vertical to horizontal

    Brilliant!
    Many thanks for you help.

  4. #4
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2404
    Posts
    13,406

    Re: Re-arrange data from vertical to horizontal

    Another non-array way. This works as long as your Products are contiguously grouped as you have them in column A.

    Copy / paste this into G3, fill down and across until you get blanks.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    The file is attached.
    Dave

+ 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. Arrange horizontal data to vertical through cut, paste, loop
    By kcheeser in forum Excel Programming / VBA / Macros
    Replies: 22
    Last Post: 03-26-2014, 04:12 PM
  2. Replies: 1
    Last Post: 11-06-2013, 11:21 AM
  3. How to arrange vertical Vcards column into horizontal rows ?
    By m.rizeg in forum Excel - New Users/Basics
    Replies: 9
    Last Post: 07-26-2013, 10:00 PM
  4. [SOLVED] how to arrange slicer look from vertical to horizontal?
    By koi in forum Excel General
    Replies: 1
    Last Post: 10-29-2012, 03:39 AM
  5. Arrange vertical string into multiple horizontal columns
    By tribalgifts in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-17-2009, 02:20 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