Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / April 2004

Tip: Looking for answers? Try searching our database.

time calculation

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
pda52 - 13 Apr 2004 04:38 GMT
I need to do a check on the time.. if it is after midnight but before 5am
then I need to minus 1 day off of the date.  How could I do this?
Dave Hawley - 13 Apr 2004 04:49 GMT
Hi

If the Date and Time is in cell A1, use

=IF(AND(MOD(A1,1)>VALUE("12:00 AM"),MOD(A1,1)<VALUE("05:00
AM")),A1+1,A1)
Dave Hawley - 13 Apr 2004 04:53 GMT
..shortened versions would be

=A1+AND(MOD(A1,1)>VALUE("12:00 AM"),MOD(A1,1)<VALUE("05:00 AM"))
Frank Kabel - 13 Apr 2004 06:56 GMT
Hi
if A1 stores a date/time value try
=A1-((MOD(A1,1)>=0)*(MOD(A1,1)<=5/24))

Signature

--
Regards
Frank Kabel
Frankfurt, Germany


> I need to do a check on the time.. if it is after midnight but before
> 5am then I need to minus 1 day off of the date.  How could I do this?
pda52 - 13 Apr 2004 21:09 GMT
Thank you that works perfectly
> Hi
> if A1 stores a date/time value try
[quoted text clipped - 7 lines]
> > I need to do a check on the time.. if it is after midnight but before
> > 5am then I need to minus 1 day off of the date.  How could I do this?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.