+ Reply to Thread
Results 1 to 7 of 7

Date and time comparison

  1. #1
    Registered User
    Join Date
    10-20-2014
    Location
    Gurgaon
    MS-Off Ver
    2007
    Posts
    10

    Date and time comparison

    Hi,

    I have a problem. I have a date time data like Dec/09/14 10:41:00. From this data I need to solve the following problem.

    We have a cut off time to do work i.e., work received after 2 PM of previous day and before 2 PM of current day will be processed on current day. Now suppose I have received some work at Sep/28/14 14:41:00, so this will be processed in Sep/29/2015 and if work received at Sep/28/14 13:41:00 this should be processed on Sep/28/2015. I have a column where we enter processed date like Sep-28-2015, Sep-29-2015 and this is the date when a particular work has processed. Now from this data I need to compare that how much I have processed on time and on how much work I missed the deadline.

    Can anybody help me please.

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Date and time comparison

    Does this help:

    =IF(AND(MOD(A2,1)>=14/24,B2<=INT(A2)+1),"OK",IF(AND(MOD(A2,1)<14/24,B2=INT(A2)),"OK","Late"))

    where A2 = receipt date/time and B2 = processing date.
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  3. #3
    Registered User
    Join Date
    10-20-2014
    Location
    Gurgaon
    MS-Off Ver
    2007
    Posts
    10

    Re: Date and time comparison

    Hi Glenn

    Above formula works for me, but I have the following issue with it:

    1. Excluding of weekends and holidays as work received on Friday after 2 PM will be processed on Monday. So as per above formula, work should be processed on Saturday otherwise it will be late but this is not the scenario. Work will be processed on Monday and same with holidays.

    2. The work received after 2 PM shouldn't be processed on the same day. So formula should throw an error.

    It will be very helpful for me if you can help me with the above issues.

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Date and time comparison

    Sure, I'll take a look, but this is a TOTALLY different question, now!!

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Date and time comparison

    OK. Try this, then:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    where M2:M6 contain a list of holidays. see the sheet....
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    10-20-2014
    Location
    Gurgaon
    MS-Off Ver
    2007
    Posts
    10
    Quote Originally Posted by Glenn Kennedy View Post
    OK. Try this, then:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    where M2:M6 contain a list of holidays. see the sheet....
    Hi Glenn,

    Thank you for your help. You solved my problem. I just have a question. I am not able to understand the logic of networkdays function means you have taken the networks days as >,= 2. What is the logic behind this?

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Date and time comparison

    It's a series of nested formulae...
    =IF(OR(NETWORKDAYS(A2,B2,$M$2:$M$6)>2,AND(MOD(A2,1)<14/24,NETWORKDAYS(A2,B2,$M$2:$M$6)=2)),"Late",
    if either the number of working days is >2 or both <14:00 and 2 working days = LATE

    IF(AND(MOD(A2,1)>=14/24,NETWORKDAYS(A2,B2,$M$2:$M$6)=2),"OK",
    if both >14:00 and 2 working days = OK

    IF(AND(MOD(A2,1)<14/24,NETWORKDAYS(A2,B2,$M$2:$M$6)=1),"OK",
    if both >14:00 and 1 working days = OK

    "")))
    otherwise leave blank.

    Glad to have helped! If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. It'd also be appreciated if you were to click the add Reputation button at the foot of any of the posts of those who helped you reach a solution.

+ 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. [SOLVED] Target Date to Completed Date Comparison Percentage output
    By FNG_to_Excel in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-25-2015, 12:32 PM
  2. [SOLVED] comparison of date and time
    By vientito in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-07-2014, 11:46 AM
  3. Date/Time Comparison
    By High_Road in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-16-2013, 09:22 AM
  4. [SOLVED] Comparison of date and time
    By swati singh in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-15-2012, 06:03 AM
  5. Date/Time Comparison
    By mauddib13 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-08-2008, 09:30 AM
  6. Time comparison formula
    By montagu in forum Excel General
    Replies: 3
    Last Post: 08-25-2005, 10:37 AM
  7. Time comparison
    By Gixxer_J_97 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-22-2005, 12:05 PM

Tags for this Thread

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