0

Formula to Round Up Time

I have a dropdown of "Choose Time"

The optios are: 30 Minutes, 1 Hour, 2 Hours, 3 Hours, Overnight

 

I also have a date and time field named "Quoted Completion"

 

When I choose a timeframe in that dropdown, I want to trigger after update the time. So I would like, if I choose 30 minutes, that it calculates now()+30 minutes, but rounded up to the next 15 minutes.

 

For example: The current date and time is Dec 21, 2018 11:37 AM. I choose in my dropdown 30 minutes, I would like the quoted completion time to be Dec 21, 2018 12:15 PM

 

If I choose overnight, I would like the trigger to calculate the time to tomorrow at 10 AM as well.

 

Can you help me with this?

Thanks!

2 replies

null
    • SMoore
    • 5 yrs ago
    • Reported - view

    Additionally, I am creating a button to determine if something was completed early, on time, or late.  

    The fields I will be working with in this formula are: 'Quoted Completion' and 'Timeliness'

    When the button is clicked, I want to update a dropdown named Timeliness. The options in Timeliness are Early (1), On Time (2) and Late (3).

    My conditions are:

    -if the completion time ( now() ) is less than 15 minutes to the Quoted Completion, I would like to mark Timeliness as Early (1).

    -if the completion time ( now() ) is greater than 15 minutes or 1 minute before Quoted Completion, I would like to mark Timeliness as On Time (2)

    -if the completion time ( now() is equal to or beyond the Quoted Completion time, I would like to mark Timeliness as Late (3)

     

    I know I would need to use if then statements, but I am not sure how to do this entirely. 

    • Birger_H
    • 5 yrs ago
    • Reported - view

    –––
    'Timeliness' := if 'Quoted Completion' - now() > time(0,15) then 1 else
    if 'Quoted Completion' - now() > time(0,1) then 2 else 3
    end
    end
    –––

    Cheers Birger

Content aside

  • 5 yrs agoLast active
  • 2Replies
  • 1523Views