PC Review


Reply
Thread Tools Rate Thread

excel time calculation

 
 
John Smith
Guest
Posts: n/a
 
      9th Nov 2006
I have a cell (E9) that has calculated the hours worked 'D9-C9(D9>C9)'
and an adjacent cell (F9) to convert this to decimal ('E9*24'). If
there is no entry in C9 and D9, F9 reads '-24'. How do I correct this
to show 0.00?
 
Reply With Quote
 
 
 
 
RobertVA
Guest
Posts: n/a
 
      9th Nov 2006
John Smith wrote:
> I have a cell (E9) that has calculated the hours worked 'D9-C9(D9>C9)'
> and an adjacent cell (F9) to convert this to decimal ('E9*24'). If
> there is no entry in C9 and D9, F9 reads '-24'. How do I correct this
> to show 0.00?


To do the entire job in one column:

=IF(C9<D9,(D9-C9)*24,0)

IF the value in column C is less than the value in column D the
difference is multiplied by 24. Otherwise (when the values are equal or
the start time is later than the end time) the formula returns zero.

Make sure you format the cells to display two decimal places so that the
numbers line up attractively.

Note that a more complicated formula would be required if the shift
starts one day and ends past midnight.
 
Reply With Quote
 
RobertVA
Guest
Posts: n/a
 
      9th Nov 2006
John Smith wrote:
> I have a cell (E9) that has calculated the hours worked 'D9-C9(D9>C9)'
> and an adjacent cell (F9) to convert this to decimal ('E9*24'). If
> there is no entry in C9 and D9, F9 reads '-24'. How do I correct this
> to show 0.00?


Additional bonus information:

The previously submitted formula/function works FINE for shifts that
start one day and end the next! You just need to enter the full date and
time (11/9/06 2:30 AM) in the data input columns (C and D). Note that
date and time entry and display formats differ in various countries.
 
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
Excel Calculation with Time MadBrotherMan Microsoft Excel Misc 1 14th Jul 2008 06:17 PM
Excel time calculation STS Microsoft Excel Worksheet Functions 3 11th Jul 2008 07:26 AM
Excel time calculation =?Utf-8?B?amM=?= Microsoft Excel Misc 2 7th Nov 2007 05:35 PM
time calculation excel =?Utf-8?B?cGFu?= Microsoft Excel Worksheet Functions 5 31st Dec 2004 09:27 AM
Excel - Time calculation =?Utf-8?B?TGV5bGFuZA==?= Microsoft Excel Misc 1 30th Nov 2004 08:43 PM


Features
 

Advertising
 

Newsgroups
 


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