Subtracting time

E

Eliott

Hello, Can someone kindly help me with this trouble.

I have a few columns formatted as h:mm.

Start Time = A2
End Time = B2
Result = C2

I want to subtract A2 from B2 (B2 - A2) and show the difference in C2.

I then want to say if C2 = 0:00 then display "Full".

If C2 > 0:00 then display "Available".

If C2 < 0:00 the display "Overbooked"


Although I do see 0:00 in the result column (C2), the logic does not work

I would greatly appreciate any help on this.
 
F

Fred Smith

Your problem is that a display of 0:00 is rounded to the minute, but the If
statement is not rounding, so if you have a difference of less than 30
seconds, it's not zero to Excel. Change C2 to:

=mround(b2-a2,1/60/24)

Regards,
Fred.
 
E

Eliott

Thank you all. I'll try and let you know.

Fred Smith said:
Your problem is that a display of 0:00 is rounded to the minute, but the If
statement is not rounding, so if you have a difference of less than 30
seconds, it's not zero to Excel. Change C2 to:

=mround(b2-a2,1/60/24)

Regards,
Fred.
 

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