rounding question

joshisms

New Member
Joined
Aug 2, 2013
Messages
14
I want to round to the quarter hour based on 7/8 minute split. I found two formulas. Is one better than the other? Any known issues using one versus the other? They both seem to work ok.

ActiveCell.FormulaR1C1 = "=ROUND(RC[-1]*96,0)/96"

ActiveCell.FormulaR1C1 = "=TIME(HOUR(RC[-1]), ROUND((MINUTE(RC[-1])/60)*4, 0) * 15, 0)"


EXAMPLE ROUNDING:
7:53 - 8:07 rounded to 8:00
8:08 - 8:22 rounded to 8:15
8:23 – 8:37 rounded to 8:30
8:38 – 8:52 rounded to 8:45
8:53 – 9:07 rounded to 9:00
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.

Forum statistics

Threads
1,223,227
Messages
6,170,853
Members
452,361
Latest member
d3ad3y3

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