Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / November 2006

Tip: Looking for answers? Try searching our database.

excel time calculation

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
John Smith - 09 Nov 2006 02:22 GMT
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?
RobertVA - 09 Nov 2006 06:48 GMT
> 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.
RobertVA - 09 Nov 2006 07:32 GMT
> 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.

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.