Rounding up/down time entries

gmeeks

New Member
Joined
Jun 18, 2002
Messages
21
I'm stumped on how to write a formula to accomplish this. Hopefully someone can help.

My start time at work is 7:00 AM. We have a 10 minute leeway either side of 7:00. If you clock in at 6:53, it rounds to 7:00. Punch in at 7:05, it rounds to 7:00. Punch in more than 10 minutes either side of 7:00 (6:45 for example) and there is no rounding. How can I write a formula to apply this rounding if I'm within the 10 minute rule?

(INFO - the "rounded" time can be shown in another cell, it doesn't have to be adjusted in the original entry)
This message was edited by gmeeks on 2002-09-26 15:05
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
This test:

=ABS(A1-7/24)<=10/1440

will return TRUE if you're within 10 minutes. The 7/24 means 7:00 A.M., and the 10/1440 means 10 minutes. You could adjust the 7 and the 10 to use different rules.
 
Upvote 0
Thanks for the reply. That will give me a true/false, but I still don't know how to change the original value based on the true/false?
 
Upvote 0
I'm sure a better way exists, but you could use this until something better is offered up
=IF(MINUTE(A1)>=50,(HOUR(A1)+1)/24,IF(MINUTE(A1)<=10,HOUR(A1)/24,A1))

where your time is in A1.

good luck
 
Upvote 0
Don't know about 'better', but a little shorter (assuming your entries are time values only & dont include a date component):

=IF(OR(A2<(410/1440),A2>(430/1440)),A2,7/24)
Book1
ABCD
1SourceRoundShorter
206:456:456:45
307:007:007:00
406:507:007:00
507:097:007:00
607:107:007:00
707:157:157:15
8
Sheet3



Paddy

EDIT: or, following Juan:


=if(ABS(A1-7/24)<=10/1440,7/24,a1)

Paddy
This message was edited by PaddyD on 2002-09-26 16:45
 
Upvote 0

Forum statistics

Threads
1,214,517
Messages
6,119,984
Members
448,935
Latest member
ijat

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top