+ Reply to Thread
Results 1 to 19 of 19

Rounding up time

  1. #1
    Registered User
    Join Date
    01-29-2019
    Location
    UK
    MS-Off Ver
    2010
    Posts
    24

    Rounding up time

    Can anyone help me with a formula to round time up in time and also in decimals

    I ideally need both the time & decimals formulas to round up in 30 mins / 0.50 increments for the first hour only and then hourly for anything beyond an hour, I could do with this as a stand alone formula and also to be nested into this time formula

    =IF(OR($G10="",$K10=""),"",CEILING(MAX(0,H10-G10),"00:30"))

    I also then need the time in decimals equivalent of both, can anyone assist on this as at the moment it is rounding up in 30min increments throughout? Many thanks

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,448

    Re: Rounding up time

    Perhaps

    =IF(OR($G10="",$K10=""),"",IF(and(h10-G10>0,h10-g10<1/24),CEILING(H10-G10,"00:30"),if(h10-g10>1/24),CEILING(H10-G10,1/24),"")))

  3. #3
    Registered User
    Join Date
    01-29-2019
    Location
    UK
    MS-Off Ver
    2010
    Posts
    24

    Re: Rounding up time

    Sorry my reply did not post for some reason.

    Hi Pepe

    Unfortunately this doesn't work, it throws up an error. Also I need to keep the time formula separate to the time in decimals formula as they are for different cells

  4. #4
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,448

    Re: Rounding up time

    What error would that be? ( I don't have a crystal ball here )
    Please post a sample sheet ( no pics please) with some data and expected results
    Thanks

  5. #5
    Registered User
    Join Date
    01-29-2019
    Location
    UK
    MS-Off Ver
    2010
    Posts
    24

    Re: Rounding up time

    it appears to be where I have underlined

    =IF(OR($G10="",$K10=""),"",IF(and(h10-G10>0,h10-g10<1/24),CEILING(H10-G10,"00:30"),if(h10-g10>1/24),CEILING(H10-G10,1/24),"")))

  6. #6
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,448

    Re: Rounding up time

    Please post a sheet as requested Thanks

  7. #7
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: Rounding up time

    Hi,

    I'd be looking at the MRound() function for an answer with this problem. Perhaps an If statement to get the Hour vs Minute round but see if it helps...

    https://exceljet.net/formula/round-t...est-15-minutes
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  8. #8
    Registered User
    Join Date
    01-29-2019
    Location
    UK
    MS-Off Ver
    2010
    Posts
    24

    Re: Rounding up time

    my existing formulas works in 30mins / 0.5 increments I just need to add in a formula to change to hourly / 1.0 increments after first hour, just wanted to know what needs to be nested in the existing formula I gave or what standalone formula I can use (if I create another column instead)

  9. #9
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,448

    Re: Rounding up time

    OK, if you rather not post a sheet, so be it.
    Good luck with your query

  10. #10
    Registered User
    Join Date
    01-29-2019
    Location
    UK
    MS-Off Ver
    2010
    Posts
    24

    Re: Rounding up time

    Hi Marvin. The Mround rounds up or down, for this I need ceiling function, but the issue I have is that I need, it to round up in 30 mins increments for first hour then hourly thereafter

  11. #11
    Registered User
    Join Date
    01-29-2019
    Location
    UK
    MS-Off Ver
    2010
    Posts
    24

    Re: Rounding up time

    Pepe I was creating a sheet for you, it wasnt that I didn't want to post one

  12. #12
    Registered User
    Join Date
    01-29-2019
    Location
    UK
    MS-Off Ver
    2010
    Posts
    24

    Re: Rounding up time

    Example sheet up with comments
    Attached Files Attached Files

  13. #13
    Valued Forum Contributor Root_'s Avatar
    Join Date
    07-29-2017
    Location
    _
    MS-Off Ver
    2010+
    Posts
    485

    Re: Rounding up time

    See if the following formulas work for you:

    =IF(OR($G10="",$K10=""),"",CEILING(MAX(0,K10-G10),((MAX(0,K10-G10)>1/24)+1)/48)) to be formatted as [h]:mm

    =IF(OR($G10="",$K10=""),"",CEILING(MAX(0,K10-G10),((MAX(0,K10-G10)>1/24)+1)/48))*24 for decimal hours

  14. #14
    Registered User
    Join Date
    01-29-2019
    Location
    UK
    MS-Off Ver
    2010
    Posts
    24

    Re: Rounding up time

    Works perfectly Root thank you, see attached sheet, yellow is the new formula, I've adapted it to work for the orange cells, but cant get it to work for the green ones, which is a bit odd.
    Attached Files Attached Files

  15. #15
    Registered User
    Join Date
    01-29-2019
    Location
    UK
    MS-Off Ver
    2010
    Posts
    24

    Re: Rounding up time

    Is there anyone who can help with this last query regarding the last work sheet I uploaded

  16. #16
    Valued Forum Contributor Root_'s Avatar
    Join Date
    07-29-2017
    Location
    _
    MS-Off Ver
    2010+
    Posts
    485

    Re: Rounding up time

    Please try

    =CEILING(MAX(0,C4),((MAX(0,C4)>1/24)+1)/48)*24

    That is, please keep reference to column C, not to column D.

  17. #17
    Registered User
    Join Date
    01-29-2019
    Location
    UK
    MS-Off Ver
    2010
    Posts
    24

    Re: Rounding up time

    Hi

    I was looking for the formula for column F to use column D not C

    I do have a formula which would calculate F using E but that again wasnt what I was after

  18. #18
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,587

    Re: Rounding up time

    Try this . In Row 4 then copy down.

    =CEILING(MAX(0,D4),MAX((D4<=1)*0.5,(D4>1)*1))
    Attached Files Attached Files
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  19. #19
    Registered User
    Join Date
    01-29-2019
    Location
    UK
    MS-Off Ver
    2010
    Posts
    24

    Re: Rounding up time

    many thanks kvsrinivasamurthy it works perfectly

+ 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] Hi & Rounding down time when the calculated time is negative
    By MrMaster in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-13-2016, 02:15 AM
  2. rounding time??
    By mkbanister in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-02-2009, 02:32 PM
  3. Converting military time to decimal time not rounding correctly
    By Sean Anderson in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-23-2008, 09:12 PM
  4. rounding time
    By MichaelMcElwee in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 09-27-2007, 10:44 AM
  5. [SOLVED] Rounding of Time
    By Morten in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 06:05 PM
  6. [SOLVED] Rounding of Time
    By Morten in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 PM
  7. Rounding Time Intervals to the Nearest Specified Time Increment
    By ExcelTip in forum Tips and Tutorials
    Replies: 0
    Last Post: 08-23-2005, 12:21 PM

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