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 / Worksheet Functions / August 2005

Tip: Looking for answers? Try searching our database.

how do I calculate hours using one cell only

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
James Fullmer - 28 Aug 2005 02:05 GMT
I am trying to create a schedule that calculates hours worked in a day.  I
have several restrictions in space, so would like to have one cell that shows
start and end time, and a second cell that shows hours worked.

For instance
A1  10:00 AM - 5:00 PM
B1  8

I am basically looking for the formula to put in B1
Alan - 28 Aug 2005 02:30 GMT
I don't think you can do it in one cell, or at least, not easily. However
with the start time in one cell and the end time in another its just simple
subtraction, subtract the start time from the end time. It gets more
complicated though if the start time is say 22:00 and the end time is 06:00
the next morning so the shift spans two days
Regards,
Alan.
>I am trying to create a schedule that calculates hours worked in a day.  I
> have several restrictions in space, so would like to have one cell that
[quoted text clipped - 6 lines]
>
> I am basically looking for the formula to put in B1
Biff - 28 Aug 2005 04:22 GMT
Hi!

See which method you might prefer:

A1 = 10:00 AM
B1 = 5:00 PM
C1 = formula:

=(B1-A1+(B1<A1))*24

OR......

A1 = 10:00 AM - 5:00 PM
B1 = formula:

=((SUBSTITUTE(A1,LEFT(A1,FIND("-",A1)+1),"")*1-SUBSTITUTE(A1,RIGHT(A1,FIND("-",A1)-1),"")*1)+(SUBSTITUTE(A1,LEFT(A1,FIND("-",A1)+1),"")*1<SUBSTITUTE(A1,RIGHT(A1,FIND("-",A1)-1),"")*1))*24

Seems like a no brainer to me! <g>

Biff

>I am trying to create a schedule that calculates hours worked in a day.  I
> have several restrictions in space, so would like to have one cell that
[quoted text clipped - 6 lines]
>
> I am basically looking for the formula to put in B1
 
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.