I\'ve an excel spreadsheet with a column which has the date and time of a particular event. I would like to round this to the nearest 15 minute interval so that I can count
If time is in cell A1:
=ROUND(A1*(24*60/15),0)/(24*60/15)
(Rounding to nearest 15 minute increment)
or
=INT(A1*(24*60/15),0)/(24*60/15)
(Rounding down to last 15 minute increment)
Simpler ??
=B2-MOD(B2,15/24/60)
Knowing that for Excel 1 day = 24 hrs = 1,
15/24/60 (= 0.0104166666666667) is the numeric equivalent equivalent of 15 min.
This worked for me
=CEILING(((MOD(D16-C16;1))*24);0,25)
It calculates the time difference of two different times C16 and D16 in hours first. Then rounds up.
mround takes time values as strings, so you can use
=mround(a1,"0:15")
which I think is the shortest and clearest method.
Just found a helpful function, MROUND, which is available in Excel 2007 and as an Analysis add-in.
Assuming your time is in B2, with a number like 8.43 to represent 8 hours, 25.8 minutes:
=MROUND(MOD(B2,1)*60,15)
the MOD(B2,1) would extract the fractional 0.43; the *60 would convert to 25.8; and the MROUND would round you to the nearest multiple of 15, namely 30.