+ Reply to Thread
Results 1 to 5 of 5

Rounding military times without colons to the nearest quarter hour

  1. #1
    Registered User
    Join Date
    01-20-2020
    Location
    Tennessee
    MS-Off Ver
    16
    Posts
    2

    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. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,679

    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. #3
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,808

    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.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  4. #4
    Registered User
    Join Date
    01-20-2020
    Location
    Tennessee
    MS-Off Ver
    16
    Posts
    2

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

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

  5. #5
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,679

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

    Glad to hear it.

    If that takes care of your original question, please take a moment to select Thread Tools from the menu above and to the right of your first post in this thread, and mark the thread as SOLVED.

    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

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Rounding time to the nearest quarter hour
    By allwrighty in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-23-2014, 02:18 PM
  2. Rounding to the nearest quarter hour, spreadsheet attached
    By jrace in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-21-2013, 04:46 AM
  3. Replies: 2
    Last Post: 01-22-2013, 02:05 PM
  4. Excel 2007 : Rounding to the nearest quarter hour
    By rski in forum Excel General
    Replies: 1
    Last Post: 06-15-2010, 07:12 PM
  5. Rounding to nearest quarter hour?
    By StargateFan in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-18-2005, 02:05 PM
  6. Rounding military time to nearest tenth of an hour
    By rcterrell in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-24-2005, 10:25 PM
  7. Rounding times to nearest quarter of an hour
    By Julia Osborne in forum Excel General
    Replies: 7
    Last Post: 04-27-2005, 05:05 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1