Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

if time bigger than...is invalid

Status
Not open for further replies.

avivit

Technical User
Jul 5, 2000
456
IL
I have a cell that holds the start time of a worker(say A1 - time format), and another to hold the time in which he leaves work(say A2 - time format).
In a third cell,I'd like to insert the result of the following condition(say A3 which holds a general format):

If A1<17:00
than a3=0
else a3=a2-a1

The probelm is that the if part of the condition, which is: A1<17:00 is invalid.
How can I check if a time is bigger or lower than another time, without adding columns that transforms the time into
number formats?
Thanks
 
Thanks Dreamboat, it looks good. I hope I'll find
there what I need.
 
If you did not find from the web site, this should work :

=IF(A1<17/24,0,(A2-A1)*24)
 
Thanks again Dreamboat, the site is more than great.
Thanks JVFriederick too. I used a variation of what u suggested, since I wanted all to be in time format in the inserted data (In your formula,A1 holds a number format, if I understand u correctly):
I kept in a certain cell (once) the value :&quot;17:00&quot; in time format (say in cell &quot;A1&quot;. Then, I used the following formula:
If C6*24<$A$1*24
then 0
else C6-$A$1

In the &quot;formula bar&quot; it looks like the following:
IF(C6*24<$A$1*24,0,C6-$A$1)

Thanks both again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top