# Rounding up/down time entries

#### gmeeks

##### New Member
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

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
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.

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?

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

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

EDIT: or, following Juan:

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

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

Wonderful! Thank you everyone for the help.

Replies
18
Views
976
Replies
4
Views
445
Replies
11
Views
374
Replies
13
Views
656
Replies
2
Views
113

1,219,828
Messages
6,150,470
Members
450,966
Latest member
Yali

### 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.

### Which adblocker are you using?

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

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