+ Reply to Thread
Results 1 to 13 of 13

how to sort grouped data?

Hybrid View

  1. #1
    Registered User
    Join Date
    08-09-2014
    Location
    HK
    MS-Off Ver
    2010
    Posts
    7

    how to sort grouped data?

    dear all, please kindly see the attachment
    i tried to group and sort with no hope
    i would like to sort by the last row of each group matching with the first row another group without losing the group
    thank you very much in advance
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,655

    Re: how to sort grouped data?

    With a help column C:
    Put this formula in cel C3 and copy down
    =IF(ISERROR(A3);C2;A3)

    Then copy , paste special , value
    Then you can sort on column C
    Willem
    English is not my native language sorry for errors
    Please correct me if I'm completely wrong

  3. #3
    Registered User
    Join Date
    08-09-2014
    Location
    HK
    MS-Off Ver
    2010
    Posts
    7

    Re: how to sort grouped data?

    Quote Originally Posted by popipipo View Post
    With a help column C:
    Put this formula in cel C3 and copy down
    =IF(ISERROR(A3);C2;A3)

    Then copy , paste special , value
    Then you can sort on column C
    thanks a lot but it didn't work.
    i suppose u replace , with ; in the formula? because it has an error if using ;
    after i sorted, i got the attached file: lost the grouping
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,655

    Re: how to sort grouped data?

    all put it in a macro
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    08-09-2014
    Location
    HK
    MS-Off Ver
    2010
    Posts
    7

    Re: how to sort grouped data?

    Quote Originally Posted by popipipo View Post
    all put it in a macro
    thanks a lot!
    however, i found it difficult to fit into my data
    attached is what i really want to do
    I tried to do the ascending instead of descending in the macro, but it does not give what i want
    sorry for the inconvenience caused
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    01-28-2014
    Location
    Turkey
    MS-Off Ver
    Excel 2013
    Posts
    159

    Re: how to sort grouped data?

    I deleted my post
    Last edited by Ali Kırksekiz; 06-08-2015 at 06:09 AM.

  7. #7
    Forum Contributor
    Join Date
    01-28-2014
    Location
    Turkey
    MS-Off Ver
    Excel 2013
    Posts
    159

    Re: how to sort grouped data?

    For H3

    IF(ROWS($H$3:H3)<=COUNT($B$3:$B$234),LARGE($B$3:$B$234,ROWS($H$3:H3)),"")
    then pull down to H234

    For G3

    =INDEX($C$3:$C$234,SMALL(IF($B$3:$B$234=H3,ROW($B$3:$B$234)-ROW($B$3)+1),COUNTIF($H$3:H3,H3)))
    This is an Array Formula confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.

    then pull down to G234

  8. #8
    Registered User
    Join Date
    08-09-2014
    Location
    HK
    MS-Off Ver
    2010
    Posts
    7

    Re: how to sort grouped data?

    Quote Originally Posted by Ali Kırksekiz View Post
    For H3

    IF(ROWS($H$3:H3)<=COUNT($B$3:$B$234),LARGE($B$3:$B$234,ROWS($H$3:H3)),"")
    then pull down to H234

    For G3

    =INDEX($C$3:$C$234,SMALL(IF($B$3:$B$234=H3,ROW($B$3:$B$234)-ROW($B$3)+1),COUNTIF($H$3:H3,H3)))
    This is an Array Formula confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.

    then pull down to G234
    thank you.
    but dear, it doesn't like working
    do I make anything wrong as per attachment?
    Attached Files Attached Files

  9. #9
    Forum Contributor
    Join Date
    01-28-2014
    Location
    Turkey
    MS-Off Ver
    Excel 2013
    Posts
    159

    Re: how to sort grouped data?

    For G3

    =IF(ROWS($J$3:J3)<=COUNT($C$3:$C$234),SMALL($C$3:$C$234,ROWS($J$3:J3)),"")
    For H3

    =INDEX($B$3:$B$234,LARGE(IF($C$3:$C$234=G3,ROW($C$3:$C$234)-ROW($C$3)+1),COUNTIF($G$3:G3,G3)))
    This in an array formula and so must be confirmed with CTRL+SHIFT+ENTER and not just ENTER.

  10. #10
    Registered User
    Join Date
    08-09-2014
    Location
    HK
    MS-Off Ver
    2010
    Posts
    7

    Re: how to sort grouped data?

    Quote Originally Posted by Ali Kırksekiz View Post
    For G3

    =IF(ROWS($J$3:J3)<=COUNT($C$3:$C$234),SMALL($C$3:$C$234,ROWS($J$3:J3)),"")
    For H3

    =INDEX($B$3:$B$234,LARGE(IF($C$3:$C$234=G3,ROW($C$3:$C$234)-ROW($C$3)+1),COUNTIF($G$3:G3,G3)))
    This in an array formula and so must be confirmed with CTRL+SHIFT+ENTER and not just ENTER.
    may I ask what is in column J? it is blank
    thanks!

  11. #11
    Forum Contributor
    Join Date
    01-28-2014
    Location
    Turkey
    MS-Off Ver
    Excel 2013
    Posts
    159

    Re: how to sort grouped data?

    This part (ROWS($J$3:J3)) is for sequence number.

    You can change this part. For example ROWS($H$3:H3) Both formulas gives same result

  12. #12
    Registered User
    Join Date
    08-09-2014
    Location
    HK
    MS-Off Ver
    2010
    Posts
    7

    Re: how to sort grouped data?

    Quote Originally Posted by Ali Kırksekiz View Post
    This part (ROWS($J$3:J3)) is for sequence number.

    You can change this part. For example ROWS($H$3:H3) Both formulas gives same result
    Thanks.
    but dear, it still gives the same result as the macro written by popipipo
    is it possble to give the "want" column in #6 groupsort-3.xlsm‎ ?

  13. #13
    Registered User
    Join Date
    08-09-2014
    Location
    HK
    MS-Off Ver
    2010
    Posts
    7

    Re: how to sort grouped data?

    a slight push for help

+ 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. How to sort Grouped data in Excel
    By bool in forum Excel General
    Replies: 20
    Last Post: 09-08-2016, 08:24 PM
  2. need to sort grouped data
    By deannab in forum Excel General
    Replies: 3
    Last Post: 11-30-2012, 02:17 PM
  3. Sort Grouped data in Excel
    By justjazziness in forum Excel General
    Replies: 0
    Last Post: 09-28-2012, 12:22 PM
  4. How to sort Grouped data in Excel
    By lly in forum Excel General
    Replies: 1
    Last Post: 08-10-2012, 08:31 PM
  5. How do you sort Grouped Data in 2003?
    By Noshiza in forum Excel General
    Replies: 9
    Last Post: 01-26-2012, 06:47 PM

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