Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Roundup / Rounddown function

I have a time-card worksheet in which I need to round time values up or down
to the nearest 1/4 hour based on the actual time an employee punches in. If
the punch in/out time is less than or equal to 7 minutes past the 1/4 hour
then the time is rounded down to that 1/4 hour. If the punch time is
greater then 7 minutes past the hour, then the time is rounded up to the
next 1/4 hour.

Example...an employee punches in at 5:33 am and punches out at 3:09 pm.

If I simply add the two times together then you get 9:36 hours worked for
the day. However, when rounding to the nearest 1/4 hour the punch in time
changes to 5:30 am and the punch out time changes to 3:15 pm. The total
hours worked for the day is not 9:45.

How can I acomplish this?

Thanks


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Roundup / Rounddown function

Why not round the results of the difference.

--
Regards,
Tom Ogilvy


"GreenMonster" wrote in message
...
I have a time-card worksheet in which I need to round time values up or

down
to the nearest 1/4 hour based on the actual time an employee punches in.

If
the punch in/out time is less than or equal to 7 minutes past the 1/4 hour
then the time is rounded down to that 1/4 hour. If the punch time is
greater then 7 minutes past the hour, then the time is rounded up to the
next 1/4 hour.

Example...an employee punches in at 5:33 am and punches out at 3:09 pm.

If I simply add the two times together then you get 9:36 hours worked for
the day. However, when rounding to the nearest 1/4 hour the punch in time
changes to 5:30 am and the punch out time changes to 3:15 pm. The total
hours worked for the day is not 9:45.

How can I acomplish this?

Thanks




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Roundup / Rounddown function

GM,

this will round a "punch time" according to your specs.

=MOD(INT((A1+TIME(0,7,0))*24*4)/24/4,1)

and avoids the use of rounddown and or mround
thus avoiding the necessity of analysis toolpak addin..

--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


GreenMonster wrote :

I have a time-card worksheet in which I need to round time values up
or down to the nearest 1/4 hour based on the actual time an employee
punches in. If the punch in/out time is less than or equal to 7
minutes past the 1/4 hour then the time is rounded down to that 1/4
hour. If the punch time is greater then 7 minutes past the hour,
then the time is rounded up to the next 1/4 hour.

Example...an employee punches in at 5:33 am and punches out at 3:09
pm.

If I simply add the two times together then you get 9:36 hours worked
for the day. However, when rounding to the nearest 1/4 hour the
punch in time changes to 5:30 am and the punch out time changes to
3:15 pm. The total hours worked for the day is not 9:45.

How can I acomplish this?

Thanks

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
Roundup and rounddown function - how to combine RonaldoOneNil Excel Worksheet Functions 1 May 28th 10 05:26 PM
Roundup and rounddown function - how to combine Stefi Excel Worksheet Functions 1 May 28th 10 05:08 PM
How do I roundup to .9 and rounddown to .9 Office Buddy Excel Worksheet Functions 3 November 17th 09 05:45 PM
rounddown + if function PoetsOnMars Excel Worksheet Functions 8 January 7th 09 02:11 PM
Roundup or rounddown Heather Excel Worksheet Functions 2 November 15th 05 02:35 AM


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

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"