Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 7
Default Converting Time to Hours & Minutes

I have time sheets that people fill out and and calculate by hand. I would
like to insert a formula that will calculate the hours and minutes worked.
An example would be:

Time In Time Out Time In Time Out # Hours
8am 11am 12pm 5:30pm 8.5


It would be even better if I could get "8 Hours and 30 Minutes" instead of
just "8.5." I'm thinking the only way to do this would be to use army time
because the am or pm will just get in the way of the calculation, but if it
is possible to leave that would be great as well.

Thanks in advance for any assistance! Let me know if there is any
additional information needed.
  #2   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 6,582
Default Converting Time to Hours & Minutes

Format the inputs as times (this is as simple as entering a number, a space,
and am or pm), then use a little math. This formula calculates the elapsed
time:

=B3-A3+D3-C3

assuming the entered values are in A3 to D3. E3 will also have a format of
0:00 AM/PM. Select the cell, go to Format menu Cells, and on the number
tab, choose a time format without am/pm.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"pugsly8422" wrote in message
...
I have time sheets that people fill out and and calculate by hand. I would
like to insert a formula that will calculate the hours and minutes worked.
An example would be:

Time In Time Out Time In Time Out # Hours
8am 11am 12pm 5:30pm 8.5


It would be even better if I could get "8 Hours and 30 Minutes" instead of
just "8.5." I'm thinking the only way to do this would be to use army
time
because the am or pm will just get in the way of the calculation, but if
it
is possible to leave that would be great as well.

Thanks in advance for any assistance! Let me know if there is any
additional information needed.



  #3   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 7
Default Converting Time to Hours & Minutes

Thanks a lot for your help. The only place I am still getting an error is
when the time goes from PM to AM. Here is what I input:


6:47 PM 11:08 PM 11:55 PM 4:38 AM #NUM!

I'm assuming I am getting the error because it is subtracting the AM from
the PM at the end. Is there any way to avoid this?

Thanks again for your assistance.


"Jon Peltier" wrote:

Format the inputs as times (this is as simple as entering a number, a space,
and am or pm), then use a little math. This formula calculates the elapsed
time:

=B3-A3+D3-C3

assuming the entered values are in A3 to D3. E3 will also have a format of
0:00 AM/PM. Select the cell, go to Format menu Cells, and on the number
tab, choose a time format without am/pm.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"pugsly8422" wrote in message
...
I have time sheets that people fill out and and calculate by hand. I would
like to insert a formula that will calculate the hours and minutes worked.
An example would be:

Time In Time Out Time In Time Out # Hours
8am 11am 12pm 5:30pm 8.5


It would be even better if I could get "8 Hours and 30 Minutes" instead of
just "8.5." I'm thinking the only way to do this would be to use army
time
because the am or pm will just get in the way of the calculation, but if
it
is possible to leave that would be great as well.

Thanks in advance for any assistance! Let me know if there is any
additional information needed.




  #4   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 6,582
Default Converting Time to Hours & Minutes

You either have to assume that the PM is from the day before and use

=B3-A3+D3+if(C3D3,1,0)-C3

or enter the date and time in the four cells, but only display the time. The
second approach is more robust.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______



"pugsly8422" wrote in message
...
Thanks a lot for your help. The only place I am still getting an error is
when the time goes from PM to AM. Here is what I input:


6:47 PM 11:08 PM 11:55 PM 4:38 AM #NUM!

I'm assuming I am getting the error because it is subtracting the AM from
the PM at the end. Is there any way to avoid this?

Thanks again for your assistance.


"Jon Peltier" wrote:

Format the inputs as times (this is as simple as entering a number, a
space,
and am or pm), then use a little math. This formula calculates the
elapsed
time:

=B3-A3+D3-C3

assuming the entered values are in A3 to D3. E3 will also have a format
of
0:00 AM/PM. Select the cell, go to Format menu Cells, and on the number
tab, choose a time format without am/pm.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"pugsly8422" wrote in message
...
I have time sheets that people fill out and and calculate by hand. I
would
like to insert a formula that will calculate the hours and minutes
worked.
An example would be:

Time In Time Out Time In Time Out # Hours
8am 11am 12pm 5:30pm 8.5


It would be even better if I could get "8 Hours and 30 Minutes" instead
of
just "8.5." I'm thinking the only way to do this would be to use army
time
because the am or pm will just get in the way of the calculation, but
if
it
is possible to leave that would be great as well.

Thanks in advance for any assistance! Let me know if there is any
additional information needed.






  #5   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 8,651
Default Converting Time to Hours & Minutes

Try =MOD(B3-A3+D3-C3,1)
though I'm surprised that you're getting a #NUM! from =B3-A3+D3-C3, as it
normally shows a ####### if you get a negative time.
--
David Biddulph

"pugsly8422" wrote in message
...
Thanks a lot for your help. The only place I am still getting an error is
when the time goes from PM to AM. Here is what I input:


6:47 PM 11:08 PM 11:55 PM 4:38 AM #NUM!

I'm assuming I am getting the error because it is subtracting the AM from
the PM at the end. Is there any way to avoid this?

Thanks again for your assistance.


"Jon Peltier" wrote:

Format the inputs as times (this is as simple as entering a number, a
space,
and am or pm), then use a little math. This formula calculates the
elapsed
time:

=B3-A3+D3-C3

assuming the entered values are in A3 to D3. E3 will also have a format
of
0:00 AM/PM. Select the cell, go to Format menu Cells, and on the number
tab, choose a time format without am/pm.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"pugsly8422" wrote in message
...
I have time sheets that people fill out and and calculate by hand. I
would
like to insert a formula that will calculate the hours and minutes
worked.
An example would be:

Time In Time Out Time In Time Out # Hours
8am 11am 12pm 5:30pm 8.5


It would be even better if I could get "8 Hours and 30 Minutes" instead
of
just "8.5." I'm thinking the only way to do this would be to use army
time
because the am or pm will just get in the way of the calculation, but
if
it
is possible to leave that would be great as well.

Thanks in advance for any assistance! Let me know if there is any
additional information needed.








  #6   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 7
Default Converting Time to Hours & Minutes

Both of the formulas worked. Thanks again for the help from both of you, it
is greatly apprecaited!

"David Biddulph" wrote:

Try =MOD(B3-A3+D3-C3,1)
though I'm surprised that you're getting a #NUM! from =B3-A3+D3-C3, as it
normally shows a ####### if you get a negative time.
--
David Biddulph

"pugsly8422" wrote in message
...
Thanks a lot for your help. The only place I am still getting an error is
when the time goes from PM to AM. Here is what I input:


6:47 PM 11:08 PM 11:55 PM 4:38 AM #NUM!

I'm assuming I am getting the error because it is subtracting the AM from
the PM at the end. Is there any way to avoid this?

Thanks again for your assistance.


"Jon Peltier" wrote:

Format the inputs as times (this is as simple as entering a number, a
space,
and am or pm), then use a little math. This formula calculates the
elapsed
time:

=B3-A3+D3-C3

assuming the entered values are in A3 to D3. E3 will also have a format
of
0:00 AM/PM. Select the cell, go to Format menu Cells, and on the number
tab, choose a time format without am/pm.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"pugsly8422" wrote in message
...
I have time sheets that people fill out and and calculate by hand. I
would
like to insert a formula that will calculate the hours and minutes
worked.
An example would be:

Time In Time Out Time In Time Out # Hours
8am 11am 12pm 5:30pm 8.5


It would be even better if I could get "8 Hours and 30 Minutes" instead
of
just "8.5." I'm thinking the only way to do this would be to use army
time
because the am or pm will just get in the way of the calculation, but
if
it
is possible to leave that would be great as well.

Thanks in advance for any assistance! Let me know if there is any
additional information needed.






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Converting total minutes into hours and minutes in Excel colette Excel Worksheet Functions 11 December 26th 07 08:24 PM
Problem with converting decimal time to hours and minutes RobertSE6 Excel Discussion (Misc queries) 6 October 22nd 07 01:00 PM
Converting a decimal time into hours and minutes LizHough Excel Worksheet Functions 1 July 4th 06 11:00 AM
converting Days Hours & minutes into just minutes in excel Six Sigma Blackbelt Excel Discussion (Misc queries) 5 April 28th 06 09:45 PM
Problem converting Hours to Days, Hours, Minutes Zyzzx Excel Worksheet Functions 4 October 24th 05 04:19 PM


All times are GMT +1. The time now is 01:37 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"