+ Reply to Thread
Results 1 to 5 of 5

formula for claculating 24 hours before or after date/time stamp

  1. #1
    Registered User
    Join Date
    04-24-2013
    Location
    san diego
    MS-Off Ver
    Excel 2007
    Posts
    4

    formula for claculating 24 hours before or after date/time stamp

    Hi...

    I'm trying to use an IF(OR formula to test whether 1 date/time stamp is within 24 hours before or after another.

    cell B2: 7/23/13 13:00 (cell formatted this way for time)
    cell D2: 7/25/13 07:00 (cell formatted this way for time)

    =IF(D2="","",IF(OR(B2=D2+1,B2=D2-1),"YES","NO")) - which isn't working for me

    thanks!

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: formula for claculating 24 hours before or after date/time stamp

    Maybe this...

    =IF(D2="","",IF(AND(B2>=D2-1,B2<=D2+1),"YES","NO"))
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Registered User
    Join Date
    04-24-2013
    Location
    san diego
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: formula for claculating 24 hours before or after date/time stamp

    that did it. thanks!

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

    Re: formula for claculating 24 hours before or after date/time stamp

    Please Login or Register  to view this content.
    Here another possibility
    Willem
    English is not my native language sorry for errors
    Please correct me if I'm completely wrong

  5. #5
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: formula for claculating 24 hours before or after date/time stamp

    You're welcome. Thanks for the feedback!

+ 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