Another Time Calulation

R

Randy

Ok...first Thanks to JLatham for my earlier question! Now I have another one...

How would I go about doing this...I am calulating time with this formula:
=IF(D16<C16,1-ABS(D16-C16),D16-C16) works great (thanks again JLatham)...

Senarioa A: I get the reults form the above formlua in cell F16...which for
this example lets say is 2:00 (11:00 PM to 1:00 AM = 2:00)

In cell F15 I would like to state this: If cell F16 (above) is less than (<)
2:00, subtract the value in cell F16 from 2:00. So in other words, something
like this...=IF(F16<2, F16-2)....I just can't seem to get the time format
correct in this formula.

Any suggestins again will be greatly appreciated. Thank you in advance for
your time.
 
B

bpeltzer

1 represents a full day. So to get hours, divide by 24. So do your
comparisons to 2/24 instead of 2.
 
R

Randy

Thank you b....however still returns ####### value....here is what I have:

=IF(F16<2/24, F16-2/24)...is this what you were referring to? I also have
the format of the cell set to "h" (without the quotes of course)
 
B

bpeltzer

The 2/24 is correct, but your logic is generating a negative.... if the time
elapsed is less than two hours, subtract two hours. I think you want
=IF(F16<2/24,2/24-F16...
That is, if the time is less than two hours, subtract it from two hours.
 
R

Randy

Ah yes....that did the trick! Thank you again for your help with this....you
too are a ROCK STAR!
 

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

Top