IF formula for time

J

Joshua

I have two columns
Time taken to complete work Completed within 24hrs

23:00 Yes
25:00 No

I want to know if anything has gone over a 24hr time limit
before I had it calculate =IF(C3>24,"NO","YES")
so if C3 was 25:00 it would give me a NO or 23:00 a YES
right now it gives me all YES even if it is over 24
Do I have to change the format of =IF cell or input a new formula

Thanks for your time
 
J

Joshua

It gives me all NO's
This is my sheet
the cell it is calculating is a formula (B2-A2) and in a custom [h]:mm format

start date complete date hrs to complete
complete within 24hr
7/1/2009 8:30 AM 7/1/2009 9:30 AM 1:00 (=B2-A2) NO
7/1/2009 8:30 AM 7/2/2009 10:30 AM 26:00 NO
 
T

T. Valko

=IF(C3>TIME(24,0,0),"NO","YES")

Look in Excel help on the TIME function and note what it says about the HOUR
argument.

Try it like this:

=IF(C3>1,"NO","YES")
 
J

Jacob Skaria

Oops....Its my mistake Joshua

=IF(TEXT(C3,"[h]")+0>24,"No","Yes")

If this post helps click Yes
---------------
Jacob Skaria


Joshua said:
It gives me all NO's
This is my sheet
the cell it is calculating is a formula (B2-A2) and in a custom [h]:mm format

start date complete date hrs to complete
complete within 24hr
7/1/2009 8:30 AM 7/1/2009 9:30 AM 1:00 (=B2-A2) NO
7/1/2009 8:30 AM 7/2/2009 10:30 AM 26:00 NO

Jacob Skaria said:
=IF(C3>TIME(24,0,0),"NO","YES")

If this post helps click Yes
 
B

Bernard Liengme

Excel stores time as fraction of a day. So 8:00 is STORED as 8/24 or 0.3333.
It is DISPLAYED as 8:00
Enter 8:00 in a cell and then format it to display as Number and you will
see 0.33333....
So to test if C3 is greater than 24 HOURS you can use
=IF(C3*24>24,"NO","YES")
best wishes
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top