Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.charting
|
|||
|
|||
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
Posted to microsoft.public.excel.charting
|
|||
|
|||
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
Posted to microsoft.public.excel.charting
|
|||
|
|||
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
Posted to microsoft.public.excel.charting
|
|||
|
|||
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
Posted to microsoft.public.excel.charting
|
|||
|
|||
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
Posted to microsoft.public.excel.charting
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Converting total minutes into hours and minutes in Excel | Excel Worksheet Functions | |||
Problem with converting decimal time to hours and minutes | Excel Discussion (Misc queries) | |||
Converting a decimal time into hours and minutes | Excel Worksheet Functions | |||
converting Days Hours & minutes into just minutes in excel | Excel Discussion (Misc queries) | |||
Problem converting Hours to Days, Hours, Minutes | Excel Worksheet Functions |