Results 1 to 5 of 5
  1. #1
    3 Star Lounger
    Join Date
    Oct 2002
    Location
    Ross-on-Wye, Herefordshire, United Kingdom
    Posts
    212
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Sorting Dates (Excel 97-SR2)

    Hi There

    I'm just looking for a possibly better solution than my own warped mind has come up with...

    Working on something which requires the user to enter a list of events, between 1 and 10, with a date and description. I need to re-sort these into date order and use them as a report heading elsewhere. I've come up with a non-VBA method of doing this. Just wondering if there is a slicker, non-VBA, method?

    Also, how can I check for entry of duplicate dates? (Somebody will put a duplicate.....)

    Attached spreadsheet extract is my particular sledgehammer for the sorting challenge. Whoops! Just noticed that the notes in the spreadsheet mentions duplicates in A2:A11, I mean B2:B11 of course!

    Regards
    Peter
    Attached Files Attached Files

  2. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Sorting Dates (Excel 97-SR2)

    Since you want to "sort" on date using SMALL, I recommend putting in another column that gets the date entered and adds the row()/100 to it. This will make all the "dates" in this column "unique" and you can use SMALL and MATCH on this range for your sorting.

    Steve

  3. #3
    3 Star Lounger
    Join Date
    Oct 2002
    Location
    Ross-on-Wye, Herefordshire, United Kingdom
    Posts
    212
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Sorting Dates (Excel 97-SR2)

    Hi Steve

    Thanks, however we type at crossed purposes. (More correctly my ability to explain clearly is lacking...)

    What I want to do is spot if the user does enter a duplicate date and pop up a warning message for them in an adjacent cell. (It's unlikely to happen, but the programmer in me likes to cover all the bases.)

    Regards
    Peter

  4. #4
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Sorting Dates (Excel 97-SR2)

    Enter something like this in C1 and copy it down the list:

    =IF(ISERROR(MATCH(B2,$B$1:B1,FALSE)),"","This is a DUPLICATE")

    Null string if unique, or "This is a DUPLICATE" for the Dupes.

    Steve

  5. #5
    3 Star Lounger
    Join Date
    Oct 2002
    Location
    Ross-on-Wye, Herefordshire, United Kingdom
    Posts
    212
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Sorting Dates (Excel 97-SR2)

    Hi Steve

    Works a treat, many thanks.

    Regards
    Peter

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •