+ Reply to Thread
Results 1 to 8 of 8

Sorting Data in groups

  1. #1
    Registered User
    Join Date
    07-15-2010
    Location
    Toronto
    MS-Off Ver
    Excel 2007
    Posts
    6

    Sorting Data in groups

    I have a file with products, each product having 4 rows of data for it.
    Each row has a row-type identifier and a product identifier and then a bunch of product related data.
    So I have these 4 row-types appearing over and over again for each product. I want to sort data based on row 1, column E of the product, so that excel filters it per product (i.e. in groups of 4 rows). How do I do that?


    I've attached the file with an example.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Sorting Data in groups

    elfnt,

    Can you post another workbook containing your Sheet1 as is, and Sheet2 with the data from Sheet1 manually sorted by you?
    Have a great day,
    Stan

    Windows 10, Excel 2007, on a PC.

    If you are satisfied with the solution(s) provided, please mark your thread as Solved by clicking EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

  3. #3
    Registered User
    Join Date
    07-15-2010
    Location
    Toronto
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Sorting Data in groups

    here it is, thanks!
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    07-15-2010
    Location
    Toronto
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Sorting Data in groups

    so far the only solution I've found is converting the rows to a single column which given the size of the spreadsheet may be very difficult to navigate (it has well over 100K lines).

  5. #5
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Sorting Data in groups

    elfnt,

    Detach/open workbook elfnt - EF742042 - VP - SDG14.xlsm and run macro ReorgData.


    The macro will create two new worksheets, MTH_L, and, FND_U.


    The macro works with you current data set in the first worksheet. The last used column in the data set is column AU. The macro searches column A for FND, and then copies the first row of each group, from column A thru AU to the NR in the new worksheets column A, then the second row to column AV..... Then it sorts the data on column BG, which is the column L in the original data set......


    If the last used column in the raw data set is not always column AU, then what would be the max last used column of any raw data set? The code can be adjusted to this max last used column, and the results will be what you are looking for.
    Attached Files Attached Files
    Last edited by stanleydgromjr; 08-19-2010 at 12:22 AM.

  6. #6
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Sorting Data in groups

    elfnt,


    Then it sorts the data on column BG, which is the column L in the original data set......

    If the last used column in the raw data set is not always column AU, then what would be the max last used column of any raw data set? The code can be adjusted to this max last used column, and the results will be what you are looking for.

    I have an idea that I will work out this morning in reference to the above quote.

    Be back soon.

  7. #7
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Sorting Data in groups

    elfnt,

    Detach/open workbook elfnt - EF742042 - VP - SDG14.xlsm and run macro ReorgData, dated 08/19/2010.
    Attached Files Attached Files

  8. #8
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Sorting Data in groups

    elfnt,


    Detach/open workbook elfnt - EF742042 - V3 - VP - SDG14.xlsm and run macro ReorgDataV3.
    Attached Files Attached Files

+ 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