+ Reply to Thread
Results 1 to 4 of 4

Grouping Rows together

  1. #1
    Registered User
    Join Date
    10-08-2009
    Location
    Granite Falls, NC
    MS-Off Ver
    Excel 2003
    Posts
    17

    Grouping Rows together

    I need to sort an worksheet by a cell that is in column D. The tricky part is that I need all the other rows to be grouped with that cell. The number of rows is not constant

    The rows that I need grouped together are the users name through Period End. The names will remain constant and the data in column D will remain constant. Hopefully I explain this well enough. Thanks for any help.


    A B C D
    KIRBY, JUSTIN AHT
    Pay Period 1/27/2010 2/2/2010
    1/28/2010 7:00 AM 1/28/2010 4:45 PM 9.75
    1/29/2010 7:00 AM 1/29/2010 2:00 PM 7
    2/1/2010 7:00 AM 2/1/2010 5:00 PM 10
    2/2/2010 6:45 AM 2/2/2010 5:30 PM 10.75
    Period Hours 37.5
    KIRBY, DAVID JHL
    Pay Period 1/27/2010 2/2/2010
    1/28/2010 5:45 AM 1/28/2010 4:30 PM 10.75
    1/29/2010 5:45 AM 2/1/2010 5:45 AM 72.00
    2/1/2010 5:45 AM 2/1/2010 10:15 AM 4.50
    2/2/2010 7:15 AM 2/2/2010 3:30 PM 8.25
    Period Hours 95.50
    COFFEY, STEVEN
    Pay Period 1/27/2010 2/2/2010
    1/28/2010 7:00 AM 1/28/2010 5:30 PM 10.50
    1/28/2010 6:15 PM 1/28/2010 8:45 PM 2.50
    1/29/2010 5:45 AM 1/29/2010 2:30 PM 8.75
    2/1/2010 7:00 AM 2/1/2010 5:45 PM 10.75
    2/2/2010 6:45 AM 2/2/2010 5:30 PM 10.75
    Period Hours 43.25
    STARNES, BRUCE JHL
    Pay Period 1/27/2010 2/2/2010
    2/1/2010 6:45 AM 2/1/2010 4:30 PM 9.75
    2/2/2010 6:00 AM 2/2/2010 7:15 AM 1.25
    Period Hours 11.00
    WHISNANT, GARY JHL
    Pay Period 1/27/2010 2/2/2010
    1/28/2010 6:00 AM 1/28/2010 4:30 PM 10.50
    1/29/2010 5:45 AM 1/29/2010 1:30 PM 7.75
    2/1/2010 6:45 AM 2/1/2010 9:00 AM 2.25
    2/2/2010 8:00 AM 2/2/2010 3:45 PM 7.75
    Period Hours 28.25

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Grouping Rows together

    Please Login or Register  to view this content.
    Can you post a sample workbook with two pages in it? On one page, the data you've shown above in the current state. On the other page, the date "grouped" in the manner you are expecting. Let us see what you're trying to accomplish.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    10-08-2009
    Location
    Granite Falls, NC
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: Grouping Rows together

    It would be just like what is shown. The sort order would be what is listed in column D. AHT then JHL. The "raw data" is not sorted by the company code (Which is column D). I am going to use vlookup to assign the company code and then want to sort by that code, but I need the rows between the persons name and the next persons name to remain in in the same order. Im sorry if I'm not describing this clearly.

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Grouping Rows together

    1) Not all your samples have a company code, Steven Coffey is missing. You'll need to make sure they all have that added.

    2) You'll need to put the code onto each row of the data for each employee. That's pretty easy.

    a) Highlight column D
    b) Press F5 and click on Special
    c) Select Blanks

    Careful now....
    d) Press the equal sign once
    e) Press the UP ARROW one time
    f) Press CTRL-ENTER

    All cells now have values, let's remove the formulas
    g) Highlight column D
    h) CTRL-C to copy
    i) Select Edit > Paste Special > Values

    Now see if you can sort the way you want.

+ 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