+ Reply to Thread
Results 1 to 5 of 5

sort data based on date and time priority

  1. #1
    Forum Contributor
    Join Date
    08-07-2008
    Location
    United States
    MS-Off Ver
    Microsoft Office 2003
    Posts
    362

    sort data based on date and time priority

    Hi everyone,

    I am creating a simple leave tracker excel file. I am having difficulty in getting the priority slot when comparing date and time. I tried using Max function but it does not give me the results I need. Attached is a sample file.

    Thanks,

    stoey
    Attached Files Attached Files
    Last edited by stoey; 02-18-2010 at 05:57 PM. Reason: change topic title

  2. #2
    Registered User
    Join Date
    07-29-2009
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2007
    Posts
    26

    Re: get the priority data base on date and time comparison

    By "first slot" I'm guessing you want it sorted so that it's at the top.

    I'm not sure how you intended to cause the event so I added a button that triggers the below code, enjoy.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by shg; 02-18-2010 at 07:12 PM. Reason: deleted spurious quote

  3. #3
    Forum Contributor
    Join Date
    08-07-2008
    Location
    United States
    MS-Off Ver
    Microsoft Office 2003
    Posts
    362

    Re: get the priority data base on date and time comparison

    Hi Justin,

    thank you for your reply...with regards to what you ask:
    By "first slot" I'm guessing you want it sorted so that it's at the top.
    yeah part of the idea is basically sorting which comes first based on the date and time criteria. I just can't think the appropriate word earlier...anyway, looking back on the test file I uploaded, the upper part which is the input basically should contains the data that are not arranged. on the output area, that is the place where i would like the sorted data to appear but only the first 3 should appear like the example i gave.

    thanks,

    stoey

  4. #4
    Forum Contributor
    Join Date
    08-07-2008
    Location
    United States
    MS-Off Ver
    Microsoft Office 2003
    Posts
    362

    Re: get the priority data base on date and time comparison

    an also by the way, can this be done automatically without having to click or place any button? like if all data on the input area were placed, then the sorted first 3 data should appear on the output area. and can this be done also without the use of a macro?

  5. #5
    Registered User
    Join Date
    07-29-2009
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2007
    Posts
    26

    Re: sort data based on date and time priority

    Here's a partial:

    Please Login or Register  to view this content.
    Put that into any cell and it will give you the first entry. The "1" in "= MIN(B6:B10,1)" can be changed to any number to give you that rank -i.e. "2" will give you the second oldest.

    Good luck with the rest.

    Why no VBA, if you don't mind?

+ 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