Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to round time to nearest hour in Excel?

How to round time to nearest hour in Excel, for example:

67:45:00 will be 68:00:00
and
53:14:00 will be 53:00:00

regards

like image 365
alwbtc Avatar asked Nov 19 '13 08:11

alwbtc


People also ask

How do you round time to the nearest hour?

When reporting time not worked, employees should round to the nearest 1/4 hour. For example: 15 minutes = 0.25 hours, 30 minutes = 0.50 hours and 45 minutes = 0.75 hours. Examples: The employee leaves early due to illness 1 hour and 45 minutes before the end of the day.

How do I round to the nearest half hour in Excel?

Enter this formula: =MROUND(A2,"0:15") or =MROUND(A2,"0:30") into a blank cell beside your data which need to round to nearest quarter or half hour, and then drag the fill handle down to the cells you want to apply this formula, and you will get a list of decimal numbers, see screenshot: 2.


3 Answers

You can use MROUND function like this

=MROUND(A1,"1:00")

like image 71
barry houdini Avatar answered Oct 19 '22 02:10

barry houdini


Assuming the time is in A1 this will round to closest hour.

=ROUND(A1*24,0)/24

  • Using ROUNDDOWN will force 67:45:00 to 67:00:00
  • Using ROUNDUP Will force 67:45:00 to 68:00:00

Same formula, change:

  • 24 to 48 for half hours.
  • 24 to 96 for quarters

If you are grouping hourly in a 24 hour span but the date is included in the time stamp, use the same formula but subtract the datevalue after:

=ROUNDDOWN(A1*24;0)/24-INT(A1)

This is useful if you want to see at what time of day something peaks over a period of time.

like image 23
Maxxarn Avatar answered Oct 19 '22 04:10

Maxxarn


Transform it to hours (5h 15m = 5.25h) then round it

if you only have it as a string use

=if(round(mid(A1;4;2);0)>29;mid(A1;1;2)+1&":00:00";mid(A1;1;2)&":00:00")

i use round to convert the minutes into a number

like image 1
Stefan Avatar answered Oct 19 '22 02:10

Stefan