# Rounding military times without colons to the nearest quarter hour

1. ## Rounding military times without colons to the nearest quarter hour

Hello everybody!

B2=0700 (start time)
C2=1530 (end time)

The formula I'm currently using is a simple (C2-B2)/100 function, but of course this yields "8.3" instead of "8.5"

Is there any way to convert my time input (interval of 15 minutes each) to the amount of hours worked (interval of 0.25 each)?

2. ## Re: Rounding military times without colons to the nearest quarter hour

Try it like this:

=CEILING(C2-B2)/100,0.25)

Hope this helps.

Pete

3. ## Re: Rounding military times without colons to the nearest quarter hour

Yes, there is a way (likely multiple ways) to solve a problem like this.

I would be inclined to use the DOLLARDE() and DOLLARFR() functions to convert your hhmm values to decimal hours, round to the nearest 0.25 hours, then, if needed, convert back to hhmm.

1) Divide by 100 to get hh.mm values
2) Use DOLLARDE(hh.mm,60) to get decimal hour
3) Round to the nearest quarter hour using MROUND(DOLLARDE(...),0.25)
4) Use DOLLARFR(MROUND(...),60) to convert rounded value back to hh.mm
5) Muliply result by 100 to hhmm value.

Others may have other suggestions.

4. ## Re: Rounding military times without colons to the nearest quarter hour

That's PERFECT!!! Thank you!!!

5. ## Re: Rounding military times without colons to the nearest quarter hour

Also, since you are relatively new to the forum, you might like to know that you can directly thank those who have helped you by clicking on the small "star" icon located in the lower left corner of a post that you have found to be helpful (not just in this thread - for any post that has helped you). This also adds to the reputation of the poster (the small green bars in the poster's profile).

Pete

There are currently 1 users browsing this thread. (0 members and 1 guests)