Hi,

I have a case where I need to divide two numbers and round up to nearest integer and store the result in a calculated field. This is commonly known as a "ceiling" function.

Example | Division | Round | Floor | Ceiling | |
---|---|---|---|---|---|

100 / 10 | 10 | 10 | 10 | 10 | |

18 / 10 | 1.8 | 2 | 1 | 2 | |

12 / 10 | 1.2 | 1 | 1 | 2 | |

3 / 10 | 0.3 | 0 | 0 | 1 |

I can only seem to find a "round" function. Neither the "Floor" og the "Ceiling" is available as far as I can see.

Any ideas on how to overcome this?

Regards

Leif

Also, there's the % operator which gives you the remainder of a division. So 18%10 will return 8. Using the If() you could come up with the calculated value formulas that you're looking for.

For example the below seems to do the trick for me (using result examples from Wikipedia):

If(equals((Val01%Val02),0),round(Val01/Val02,0),(Val01-(Val01%Val02))/Val02) - If(lessThan((Val01/Val02),0),1,0)

If(equals((Val01%Val02),0),Val01/Val02,((Val01-(Val01%Val02))/Val02)+1) - If(lessThan((Val01/Val02),0),1,0)

The subtraction part is to compensate for negative numbers.