If I'm using a numeric formula, what is the formula to round time to nearest 15 min, and convert time: 15 min=.25; 30 min=.50; 45 min=.75?

  • 0
  • 1
  • Question
  • Updated 3 years ago
  • Answered

I tried this but it doesn't work:  

If(

Frac([Duration LogIn/LogOut Time])<=0.08,Int([Duration LogIn/LogOut Time]),0,

Frac([Duration LogIn/LogOut Time])<=0.23,Int([Duration LogIn/LogOut Time]),0.25,

Frac([Duration LogIn/LogOut Time])<=0.38,Int([Duration LogIn/LogOut Time]),0.5,

Frac([Duration LogIn/LogOut Time])<=0.53,Int([Duration LogIn/LogOut Time]),0.75,

Frac([Duration LogIn/LogOut Time])<=0.59,Int([Duration LogIn/LogOut Time]),1

)

Photo of Suzanne

Suzanne

  • 10 Points

Posted 3 years ago

  • 0
  • 1
Not tested but try this and let me know if it works

Hours(Round([Duration LogIn/LogOut Time],Minutes(15)))
Photo of Suzanne

Suzanne

  • 10 Points
Didn't work, but thanks anyway!
what there a syntax error or incorrect results?  if a syntax error what was the error.
Photo of Suzanne

Suzanne

  • 10 Points
Formula error -- Bad or missing arguments in function call

The types of the arguments or the number of arguments supplied do not meet the requirements of the function Frac.

The function is defined to be Frac (Number n).

You may need to do one of the following to fix the problem:
Choose the right number and type of arguments.
Use a type conversion function to convert the arguments you are using to the correct type.
Choose a different function.
Photo of Suzanne

Suzanne

  • 10 Points
Formula error -- Bad or missing arguments in function call

The types of the arguments or the number of arguments supplied do not meet the requirements of the function Hours.

The function is defined to be Hours (Number n).

You may need to do one of the following to fix the problem:
Choose the right number and type of arguments.
Use a type conversion function to convert the arguments you are using to the correct type.
Choose a different function.
Try this

ToHours(Round([Duration LogIn/LogOut Time],Minutes(15)))
Photo of Suzanne

Suzanne

  • 10 Points
ToHours(Round([Duration LogIn/LogOut Time],Minutes(15))) Worked!!! Thanks :smile:
:) thx for letting me know.