Skip to main content
A picture of my issue in shown below. Total Time is controlled by two Date/Time fields that my users have to fill in. The seconds are screwing up the hours and showing .99 and .49 frequently. I made a formula field (Total Time.) with the formula ROUND(Total_Time__c, 1) to accomodate these cases.

 

This handles all of the circumstances except for the 9.40 one. My user can't finish a job the same time he starts one, so he had to end this one at 11:55 am, so he could start the next one at 12, giving me a .4 number. Is there a way to edit my formula to round any decimal under .5 to .5, and anything over .5 to the next whole number?

 

Rounding Numbers to .5 and whole numbers
5 件の回答
  1. 2015年8月5日 13:49

    Try this then - 

    FLOOR(Total_Time__c) +

    IF(

    Total_Time__c - FLOOR(Total_Time__c) <= 0.1, /* [0.1 => 0] */

    0,

    IF(

    Total_Time__c - FLOOR(Total_Time__c) <= 0.6, /* [0.11 <= X <= 0.60 => 0.5] */

    0.5,

    1 /* [0.61 <= X <= 0.99 => 1] */

    )

    )

0/9000