Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I'd like to create a excel file to calculate the hours worked.
Col A Col B Col C Col D Date Time IN Time OUT hrs worked in col B, record Time IN 7:53am in col C, record Time OUT 6:05pm However, 7:53am expects to count as 8:00am & 6:05pm count as 6:00pm, and hours worked results as 10 hours I wish to keep the records of the Time IN & OUT in the actual time and how to set the formula to calculate in form of the expected result in col D ? |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
=MROUND(C1,15/24/60)-MROUND(B1,15/24/60)
Change both "15"s to any number of minutes you want to round to. If you get a #NAME error: ToolsAdd-ins, check Analysis Toolpak -- Kind regards, Niek Otten Microsoft MVP - Excel "yclhk" wrote in message ... | I'd like to create a excel file to calculate the hours worked. | Col A Col B Col C Col D | Date Time IN Time OUT hrs worked | | in col B, record Time IN 7:53am | in col C, record Time OUT 6:05pm | However, 7:53am expects to count as 8:00am & | 6:05pm count as 6:00pm, and hours worked results as 10 hours | | I wish to keep the records of the Time IN & OUT in the actual time and | how to set the formula to calculate in form of the expected result in col D ? |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
And format as time
-- Kind regards, Niek Otten Microsoft MVP - Excel "Niek Otten" wrote in message ... | =MROUND(C1,15/24/60)-MROUND(B1,15/24/60) | | Change both "15"s to any number of minutes you want to round to. | | If you get a #NAME error: ToolsAdd-ins, check Analysis Toolpak | | -- | Kind regards, | | Niek Otten | Microsoft MVP - Excel | | "yclhk" wrote in message ... || I'd like to create a excel file to calculate the hours worked. || Col A Col B Col C Col D || Date Time IN Time OUT hrs worked || || in col B, record Time IN 7:53am || in col C, record Time OUT 6:05pm || However, 7:53am expects to count as 8:00am & || 6:05pm count as 6:00pm, and hours worked results as 10 hours || || I wish to keep the records of the Time IN & OUT in the actual time and || how to set the formula to calculate in form of the expected result in col D ? | | |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
As with so many posts on this group, you haven't included enough detail in
the question, nor does your example make it clear. How do you do the rounding at each end of the working day? To units of an hour, or half an hour, or a quarter of an hour? Do you round to the nearest unit, or does the employee always lose out on the rounding at each end of the working day? Do you want a result as an Excel time, or as decimal hours? [In other words, would you want 8:30 or 8.5?] Can the time worked span midnight? Do you need the formula to return a blank in cases where you haven't yet filled in times for IN and OUT? Once you've sorted out the question, the answer will probably be relatively easy. Making a guess at some of the answers, you may want something like: =IF(OR(B2="",C2=""),"",FLOOR(C2*24,0.25)-CEILING(B2*24,0.25)) -- David Biddulph "yclhk" wrote in message ... I'd like to create a excel file to calculate the hours worked. Col A Col B Col C Col D Date Time IN Time OUT hrs worked in col B, record Time IN 7:53am in col C, record Time OUT 6:05pm However, 7:53am expects to count as 8:00am & 6:05pm count as 6:00pm, and hours worked results as 10 hours I wish to keep the records of the Time IN & OUT in the actual time and how to set the formula to calculate in form of the expected result in col D ? |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
On Mon, 24 Dec 2007 22:34:01 -0800, yclhk
wrote: I'd like to create a excel file to calculate the hours worked. Col A Col B Col C Col D Date Time IN Time OUT hrs worked in col B, record Time IN 7:53am in col C, record Time OUT 6:05pm However, 7:53am expects to count as 8:00am & 6:05pm count as 6:00pm, and hours worked results as 10 hours I wish to keep the records of the Time IN & OUT in the actual time and how to set the formula to calculate in form of the expected result in col D ? Assuming you want to round to the nearest 1/4 hour, use one of the following formulas, depending on whether or not you have the Analysis Tool Pak installed. If you want to round to the nearest hour, or 30 minutes, change the "15" in the formula to 30 or 60. =ROUND(Time_OUT/TIME(0,15,0),0)*TIME(0,15,0)-ROUND(Time_IN/TIME(0,15,0),0)*TIME(0,15,0) =MROUND(Time_OUT,TIME(,15,))-MROUND(Time_IN,TIME(,15,)) The formulas assume that there will be no work hours that span midnight, but they can be altered to take that into account if necessary. FORMAT the result as [h]:mm (or similar) --ron |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi,
This is quite late to reply but you can still try this out. A B C D Date Time In Time Out Hrs Worked dd/mm/yy 7.53 18.05 10.52 Since excel stores time in fractions the calculation above comes to, assuming that the data starts from column A. =(C3/24-B3/24)*24 That is (7.53 am /24 - 6.05 pm /24)*24 = 10.52 hrs Only one thing make sure that the cells are formatted in numbers and the data is entered in 00.00 hrs. -- Thanks Suleman Peerzade "yclhk" wrote: I'd like to create a excel file to calculate the hours worked. Col A Col B Col C Col D Date Time IN Time OUT hrs worked in col B, record Time IN 7:53am in col C, record Time OUT 6:05pm However, 7:53am expects to count as 8:00am & 6:05pm count as 6:00pm, and hours worked results as 10 hours I wish to keep the records of the Time IN & OUT in the actual time and how to set the formula to calculate in form of the expected result in col D ? |
#7
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thanks for all,
However, your method would help to make easy to enter the time. Enter 7.53 is more easy to enter 7:53. But, what I want is the formula to count 7.53 as 8.00am and 18.05 as 6.00pm, and with the result of 10.00 hrs worked. Thanks a lot, "Suleman Peerzade" wrote: Hi, This is quite late to reply but you can still try this out. A B C D Date Time In Time Out Hrs Worked dd/mm/yy 7.53 18.05 10.52 Since excel stores time in fractions the calculation above comes to, assuming that the data starts from column A. =(C3/24-B3/24)*24 That is (7.53 am /24 - 6.05 pm /24)*24 = 10.52 hrs Only one thing make sure that the cells are formatted in numbers and the data is entered in 00.00 hrs. -- Thanks Suleman Peerzade "yclhk" wrote: I'd like to create a excel file to calculate the hours worked. Col A Col B Col C Col D Date Time IN Time OUT hrs worked in col B, record Time IN 7:53am in col C, record Time OUT 6:05pm However, 7:53am expects to count as 8:00am & 6:05pm count as 6:00pm, and hours worked results as 10 hours I wish to keep the records of the Time IN & OUT in the actual time and how to set the formula to calculate in form of the expected result in col D ? |
#8
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
HI,
You can probably round number to the nearest Zero (Assuming that you have entered the data in number format). for eg. Date Time In Rounded Time Time Out Rounded Time Hrs Worked dd/mm/yy 7.53 8.00 18.05 18.00 10.00 you can enter the data in number formate, add one more column besides both time in and time out, you can name them as rounded time in and rounded time out. The formula for rounding would be. =ROUND(D32,0) and the total hrs worked formula can be changed accordingly to give you 10 hrs (Consider the rounded columns). =(G32/24-E32/24)*24 -- Thanks Suleman Peerzade "yclhk" wrote: Thanks for all, However, your method would help to make easy to enter the time. Enter 7.53 is more easy to enter 7:53. But, what I want is the formula to count 7.53 as 8.00am and 18.05 as 6.00pm, and with the result of 10.00 hrs worked. Thanks a lot, "Suleman Peerzade" wrote: Hi, This is quite late to reply but you can still try this out. A B C D Date Time In Time Out Hrs Worked dd/mm/yy 7.53 18.05 10.52 Since excel stores time in fractions the calculation above comes to, assuming that the data starts from column A. =(C3/24-B3/24)*24 That is (7.53 am /24 - 6.05 pm /24)*24 = 10.52 hrs Only one thing make sure that the cells are formatted in numbers and the data is entered in 00.00 hrs. -- Thanks Suleman Peerzade "yclhk" wrote: I'd like to create a excel file to calculate the hours worked. Col A Col B Col C Col D Date Time IN Time OUT hrs worked in col B, record Time IN 7:53am in col C, record Time OUT 6:05pm However, 7:53am expects to count as 8:00am & 6:05pm count as 6:00pm, and hours worked results as 10 hours I wish to keep the records of the Time IN & OUT in the actual time and how to set the formula to calculate in form of the expected result in col D ? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Converting a time format to a String format in Excel | Excel Discussion (Misc queries) | |||
Custom Cell format to mimic time format | Excel Discussion (Misc queries) | |||
convert time imported as text to time format for calculations | Excel Worksheet Functions | |||
How to format cells in Excel for time in format mm:ss.00 | Excel Worksheet Functions | |||
Remove time from a date and time field? Format removes the displa. | Excel Worksheet Functions |