PC Review


Reply
Thread Tools Rate Thread

MORE HELP WITH TIME FUNCTION

 
 
John Smith
Guest
Posts: n/a
 
      10th Nov 2006
I have a cell (E11) that has calculated the hours worked
'D11-C11(D11>C11)'. If that amount is greater than 5.5 hours (which it
usually is), I need to subtract a one half hour meal period from the
total. I have tried '=IF(D11-C11>="5:30",D11-C11-"0:30",D11-C11)' but
it does not work. What am I not doing or doing wrong?
 
Reply With Quote
 
 
 
 
Ron Rosenfeld
Guest
Posts: n/a
 
      10th Nov 2006
On Thu, 09 Nov 2006 21:35:03 -0500, John Smith <(E-Mail Removed)> wrote:

>I have a cell (E11) that has calculated the hours worked
>'D11-C11(D11>C11)'. If that amount is greater than 5.5 hours (which it
>usually is), I need to subtract a one half hour meal period from the
>total. I have tried '=IF(D11-C11>="5:30",D11-C11-"0:30",D11-C11)' but
>it does not work. What am I not doing or doing wrong?


What you are doing wrong is assuming that Excel knows you mean five and a half
hours when you use the string "5:30" in the Boolean expression and not the
string "5:30".

In formulas, it is best to use unambiguous representations.

You could use

TIME(5,30,0)

or

TIMEVALUE("5:30")

or even

--"5:30"

Excel will try to convert the value to time if it is used in a mathematical
expression, so you can get away with "0:30" when you are subtracting it. But
not so in the Boolean expression.




--ron
 
Reply With Quote
 
bobocat
Guest
Posts: n/a
 
      10th Nov 2006
For you information, 5.5 hours = 1/24*5.5, half an hour = 1/24*0.5
therefore , the formula should be

=if(d11-c11>=1/24*5.5, d11-c11-1/24*0.5, d11-c11)
then set the answer in time format

or
=text(if(d11-c11>=1/24*5.5, d11-c11-1/24*0.5, d11-c11),"hh:mm")


"John Smith" <(E-Mail Removed)> ???????:(E-Mail Removed)...
>I have a cell (E11) that has calculated the hours worked
>'D11-C11(D11>C11)'. If that amount is greater than 5.5 hours (which it
>usually is), I need to subtract a one half hour meal period from the total.
>I have tried '=IF(D11-C11>="5:30",D11-C11-"0:30",D11-C11)' but it does not
>work. What am I not doing or doing wrong?



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there an XLS function to convert std time to Military time? Carl Microsoft Excel Worksheet Functions 0 20th May 2009 10:30 PM
Macro / function text time to 24hr excel time passed midnight fortotaling hr's Russmaz Microsoft Excel Worksheet Functions 2 6th Mar 2009 05:58 AM
verify use of TIME Function, Find Quantity Level compare to time-d =?Utf-8?B?bmFzdGVjaA==?= Microsoft Excel Misc 9 11th Jul 2007 02:58 PM
Function Call Specified at Run Time rather than Compile Time? Mac Lingo Microsoft Excel Programming 1 8th Sep 2005 05:20 PM
Add Event Handler Dynamically, but assigning function name at run-time, not to static function Jose Suero Microsoft ASP .NET 2 26th Dec 2003 09:40 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:14 PM.