#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default 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.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default 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.


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,389
Default 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.


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default 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.

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 173
Default 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.



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default 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.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Subtracting Dates to get total time work time excluding weekends Jon Ratzel[_2_] Excel Discussion (Misc queries) 2 January 31st 08 10:36 PM
subtracting time Ivano Excel Worksheet Functions 4 January 2nd 08 04:52 PM
subtracting time JR Excel Worksheet Functions 4 February 23rd 06 06:44 PM
Subtracting Time bunnyc Excel Discussion (Misc queries) 2 February 23rd 06 04:31 PM
Subtracting Time Jason Excel Worksheet Functions 2 April 15th 05 09:07 PM


All times are GMT +1. The time now is 10:39 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"