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

1. ## 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. ## 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"))

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

that did it. thanks!

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

``Please Login or Register  to view this content.``
Here another possibility

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

You're welcome. Thanks for the feedback!

There are currently 1 users browsing this thread. (0 members and 1 guests)

#### 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