excel - Calculate the difference and sum of two times and round to the nearest 1/4 hour in decimal format -


i trying create simple spreadsheet accurately calculate difference between 2 times, on 3 separate periods in day staff payroll purposes. there start , end time each input exact minute in 24 hour time (07:21, 22:42 etc). there total column each of 3 periods needs sum work time, convert decimal, , round nearest 1/4 hour (i.e: 4.75 hours) in 1 formula.

i can achieve 1 or other, cannot formulas work reason. have tried int, round, minute etc based on following:

=((round(c9*96,0)/96)*24)-((round(b9*96,0)/96)*24)  =int(c9)*24+hour(c9)+round(minute(c9)/60,2)-int(b9)*24+hour(b9)+round(minute(b9)/60,2) 

and several hundred variations.

i think overthinking one, , not using correct formula.

mround allows round nearest multiple (which doesn't have integer). date/time values in excel stored fractional numbers of days, convert hours can multiply 24. putting gives:

=mround(24*(c9-b9),0.25) 

Comments

Popular posts from this blog

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - how to use buttonedit in devexpress gridcontrol -

nvd3.js - angularjs-nvd3-directives setting color in legend as well as in chart elements -