+ Reply to Thread
Results 1 to 16 of 16

Group sort needed - have burned the candle at both ends!

Hybrid View

  1. #1
    Registered User
    Join Date
    10-16-2012
    Location
    NY NY
    MS-Off Ver
    Excel 2003
    Posts
    8

    Group sort needed - have burned the candle at both ends!

    I have a spreadsheet with 13,000 rows. The rows come in groups: 3 or 4 rows have the same case number - there are about unique 4000 cases. The next column over has ONE additional number for only ONE of those rows - the rest of the cells are blank for all the other matching case number rows. I would do a normal sort, but for the fact that MOST of those cases do not have that additional number, and must be scrapped. I need to do a group sort based on that one additional piece of information, and then keep the case numbers together. Unfortunately, I can't upload a sample. I think it's disabled here at work. will the table below post correctly, I wonder...

    Case # 1017654 has the matching MIS ID: 605635. How can I sort all the 1017654 rows to stay grouped with the 605635 row, so that all the rows with case numbers and NO MISID move to the bottom where they'll be deleted?

    Thanks.

    [table="width: 500, class: grid, align: left"]
    casenum MIS id suffix line action_code action_dt seq_no
    10124 01 01 168L 08/20/2012 10
    10124 01 01 169I 09/05/2012 10
    10124 01 01 169D 09/05/2012 5
    101499 01 01 168L 07/12/2012 10
    101499 01 01 169D 09/24/2012 50
    101499 01 01 169I 09/24/2012 55
    101499 01 01 168L 09/24/2012 10
    1017654 01 01 168L 08/29/2012 15
    1017654 01 01 169D 09/11/2012 5
    1017654 01 01 169I 09/13/2012 10
    1017654 605635 01 01 169I 9/13/2012 10
    1019483 01 01 169I 07/11/2012 20
    1019483 01 01 169D 07/11/2012 15

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Group sort needed - have burned the candle at both ends!

    Okay, since you can't upload;
    Assuming Case ID in Column A
    Is 605636, the only value (in your example) in Col B?
    Why don't you just sort on Col B, bringing all the blanks together and delete them?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    10-16-2012
    Location
    NY NY
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Group sort needed - have burned the candle at both ends!

    Because I need some of those blank rows.

    I need them wherever they contain the same case as the row that has the extra value.

    I was able to upload the example after all: I've highlighted about 3 cases. Cases that I want to save are in light yellow, and all have identical case numbers, with one that has an MIS_ID number. Scroll down to find them. All the other rows (no color) contain cases that I want to dump, because they have no matching MIS_ID.

    Thanks!
    Attached Files Attached Files

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Group sort needed - have burned the candle at both ends!

    Here's a way, In H2 dragged down

    =IF(SUMIF(A2:$A$102,A2,B2:$B$102)>0,A2,"")

    Then select all data including H and filter on Blanks
    Delete all visible rows

    FYI: Rows 86:88 should not be yellow, they are a different number.
    Last edited by ChemistB; 10-16-2012 at 04:06 PM.

  5. #5
    Registered User
    Join Date
    10-16-2012
    Location
    NY NY
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Group sort needed - have burned the candle at both ends!

    By God, I think you've got it!!

  6. #6
    Registered User
    Join Date
    10-16-2012
    Location
    NY NY
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Group sort needed - have burned the candle at both ends!

    Chemist, I am waiting with bated breath to see if this solution fully works for me...I think it will. (our system is unbelievably slow) In the meantime, thank you!

  7. #7
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Group sort needed - have burned the candle at both ends!

    Glad to hear it's working.

  8. #8
    Registered User
    Join Date
    10-16-2012
    Location
    NY NY
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Group sort needed - have burned the candle at both ends!

    Now I have a similar request, only the data is in a different order. I need all blank cells completed for the same case numbers. Only one of the cells has the complete information. Please see the attached.
    Attached Files Attached Files

  9. #9
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Group sort needed - have burned the candle at both ends!

    In A2

    =LOOKUP(B2,$B$2:$B$15,$A$2:$A$15)
    Then copy and paste that formula into all other blank cells.

  10. #10
    Registered User
    Join Date
    10-16-2012
    Location
    NY NY
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Group sort needed - have burned the candle at both ends!

    The lookup worked for the sample, but not when I added different values below, please see the attached.
    Attached Files Attached Files

  11. #11
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Group sort needed - have burned the candle at both ends!

    In A2

    =INDEX(A3:$A$26,COUNTIF($B2:$B$26,B2)-1), copied into all blank cells

  12. #12
    Registered User
    Join Date
    10-16-2012
    Location
    NY NY
    MS-Off Ver
    Excel 2003
    Posts
    8

    Thumbs up Re: Group sort needed - have burned the candle at both ends!

    Beautiful!

    Thanks!!

    Naomi

  13. #13
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Group sort needed - have burned the candle at both ends!

    It worked originally because each number was greater than the last. I need to re-evaluate.

  14. #14
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Group sort needed - have burned the candle at both ends!

    @ NaomiNaomi

    Welcome to the forum.

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. I'll do that for you now but please keep in mind for your future threads that Rule #9 requires you to do that yourself. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

    Also, as a new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

  15. #15
    Registered User
    Join Date
    10-16-2012
    Location
    NY NY
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Group sort needed - have burned the candle at both ends!

    Thanks for finishing this off for me, and I had already starred chemist B twice!

  16. #16
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Group sort needed - have burned the candle at both ends!

    LOL, thank you NaomiNaomi

+ 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