Time calculation help please

Jay2000

New Member
Joined
Dec 5, 2005
Messages
6
I am trying to compute a formula which will allow me to figure out the hours worked for a person. It worked very well until I ran into third shift people who would work beyond 12:00am.

I then found the following formula:

=TEXT(IF(B1<A1,1-A1+B1,B1-A1),"hh:mm")

However this returns the time they worked and not a number.

For example:

Time In 5:30 PM
Time Out 2:00 AM
Total Time worked 8:30 is what is returned
What I want is 8.5

Unfortunately, I think I am making this harder than it is and I am drawing a blank.

Thank you

Jay
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Jay2000 said:
I am trying to compute a formula which will allow me to figure out the hours worked for a person. It worked very well until I ran into third shift people who would work beyond 12:00am.

I then found the following formula:

=TEXT(IF(B1<A1,1-A1+B1,B1-A1),"hh:mm")

However this returns the time they worked and not a number.

For example:

Time In 5:30 PM
Time Out 2:00 AM
Total Time worked 8:30 is what is returned
What I want is 8.5

Unfortunately, I think I am making this harder than it is and I am drawing a blank.

Thank you

Jay

Why are you returning text, by using the TEXT function? Multiply by 24 to return a decimal number.
 
Upvote 0
Hmm...

For some reason my formula did not post.

Hopefully it will post this time:

=TEXT(IF(B1<A1,1-A1+B1,B1-A1),"hh:mm")
 
Upvote 0
Just multiply your function by 24 and format your cell as General or Number.
 
Upvote 0
Re: Hmm...

Jay2000 said:
For some reason my formula did not post.

Hopefully it will post this time:

=TEXT(IF(B1<A1,1-A1+B1,B1-A1),"hh:mm")

Code:
=TEXT(IF(B1<A1,1-A1+B1,B1-A1)

Is that your formula?

Use the Code button before and after the code you want to enter.
 
Upvote 0

Forum statistics

Threads
1,214,922
Messages
6,122,281
Members
449,075
Latest member
staticfluids

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top