#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 48
Default Time Format

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,440
Default Time Format

=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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,440
Default Time Format

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,651
Default Time Format

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default Time Format

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 189
Default Time Format

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 48
Default Time Format

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 189
Default Time Format

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
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 a time format to a String format in Excel Bill Partridge Excel Discussion (Misc queries) 3 October 3rd 07 11:48 AM
Custom Cell format to mimic time format [email protected] Excel Discussion (Misc queries) 6 November 7th 06 09:17 PM
convert time imported as text to time format for calculations batfish Excel Worksheet Functions 3 October 27th 05 11:24 PM
How to format cells in Excel for time in format mm:ss.00 Very Timely Excel Worksheet Functions 0 March 30th 05 07:35 AM
Remove time from a date and time field? Format removes the displa. oaoboc Excel Worksheet Functions 1 February 16th 05 07:20 PM


All times are GMT +1. The time now is 12:12 AM.

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

About Us

"It's about Microsoft Excel"