View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
a7n9
 
Posts: n/a
Default ... round a time entry to the next "30 minute increment"...

Although, this is not elegant it should get you started, suppose D5 has your
time.
=IF(MINUTE(D5)<30,TIME(HOUR(D5),0,0),IF(D530,TIME (HOUR(D5)+1,0,0),D5))

Actually, the functions CEILING and FLOOR could be used, but I can't figure
it right now.
--
-When you get to the end of your rope, tie a knot and hang on
<a href="www.nandeshwar.info/projects/xlblog"My Excel/VBA Page</a


"Dr. Darrell" wrote:

I have a worksheet that I enter time values into individual cells:

A1 = 6:00
B1 = 12:00
C1 = 12:45
D1 = 17:15

When I enter these values, I would like some of the values to round to the
next higher "30 minute increment" such as Cell C1 should become 13:00.

I would also like some of the values to round back to the next lower "30
minute increment" such as Cell D1 should become 17:00.

What function should I use, or what code should I type for this.

Darrell