View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JNW JNW is offline
external usenet poster
 
Posts: 480
Default Round time to quarter hour

=IF(A1-FLOOR(A1,0.01041666667)CEILING(A1,0.01041666667)-A1,CEILING(A1,0.01041666667),FLOOR(A1,0.0104166666 7))

The above formula will round to the NEAREST quarter hour.

If you only want to round up, use
=ceiling(a1,0.01041666667).
If you only want to round down, use
=floor(a1,0.01041666667)
--
JNW


"pdberger" wrote:

Good afternoon --

I'm having problems setting up a time sheet template, which requires
rounding the employee's time to the nearest quarter hour. Here's what I've
got:

A B
1 7:12 AM =MROUND(A1,0.010417)

The 0.010417 number I believe to be the decimal value for 15 minutes. At
any rate, the resulting figure in cell B1 is 7:17 AM, instead of 7:15 AM like
I want.

What am I doing wrong?

Thanks in advance.