ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Subtracting time (https://www.excelbanter.com/excel-worksheet-functions/184608-subtracting-time.html)

Eliott

Subtracting time
 
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.

Pete_UK

Subtracting time
 
Try this:

=IF(C2=0,"Full",IF(C20,"Available","Overbooked"))

Hope this helps.

Pete

On Apr 21, 10:15*pm, Eliott wrote:
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.



Fred Smith[_4_]

Subtracting time
 
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.

"Eliott" wrote in message
...
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.



Max

Subtracting time
 
Try:
=IF(COUNT(A2:B2)<2,"",IF(B2-A2<0,"Overbooked",IF(B2-A20,"Available","Full")))
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Eliott" wrote:
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.


roadkill

Subtracting time
 
Have you tried changing the format of C2 from time to a number?

"Eliott" wrote:

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.


Eliott

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

"Fred Smith" wrote:

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.

"Eliott" wrote in message
...
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.





All times are GMT +1. The time now is 04:56 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com