Re: If statement for time
- From: "David Biddulph" <groups [at] biddulph.org.uk>
- Date: Tue, 10 Jun 2008 12:53:44 +0100
Perhaps Joel intended to use MOD(...,1), rather than INT(...) ?
--
David Biddulph
"Sandy Mann" <sandymann2@xxxxxxxxxxxxxx> wrote in message
news:un$%23ezuyIHA.2188@xxxxxxxxxxxxxxxxxxxxxxx
"Joel" <Joel@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:ECEE45FF-CC1A-4131-8CBA-159C07F948E2@xxxxxxxxxxxxxxxx
The Int() rounds the time value to remove the date.
Are you sure? Times are a fraction so the INT() is removing the fraction,
(ie time), not the whole number (ie Date)
--
HTH
Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings
sandymann2@xxxxxxxxxxxxxx
Replace @mailinator.com with @tiscali.co.uk
"Joel" <Joel@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:ECEE45FF-CC1A-4131-8CBA-159C07F948E2@xxxxxxxxxxxxxxxx
use the Hour function
Mytime = TimeValue("09/01/2008 16:53")
If (Hour(Mytime) >= 9) And (Hour(Mytime) <= 17) Then
a = 1
End If
or
=IF(AND(HOUR(B5)>=9,HOUR(B5)<=17),"Yes","No")
these solutions don't include exactly 5:00 PM
Another solution
Mytime = TimeValue("09/01/2008 16:53")
If (Int(Mytime) >= timevalue("9:00 AM")) And (Int(Mytime) <=
timevalue(5:00
PM")) Then
End If
=IF(AND(int(B5)>=timevalue("9:00 AM"),Int(B5)<=timevalue("5:00
PM")),"Yes","No")
The Int() rounds the time value to remove the date.
"Dom" wrote:
Hi I have been working on some information that shows when a job was
logged
and when it was then completed. I have times for these both and have
been
able to work out the difference between these dates in workdays and
figure
out the times ( dd:hh:mm) but I now need an if statement for if the time
to
only count hours after 9am and before 5pm. For example I want to work
out 32
working hours from
09/01/2008 06:53
I have worked out the working days so I currently have
10/01/2008 14:53
but I only want it to work out the 32 hours from 09:00 - 17:00 every
day
Is there any way of doing this?
.
- References:
- RE: If statement for time
- From: Joel
- Re: If statement for time
- From: Sandy Mann
- RE: If statement for time
- Prev by Date: beginner question re =PROPER(A1) command
- Next by Date: Re: beginner question re =PROPER(A1) command
- Previous by thread: Re: If statement for time
- Next by thread: RE: If statement for time
- Index(es):
Relevant Pages
|