Brian Dunning's FileMaker Custom Functions

SuperCeiling ( Number , RoundTo )

This custom function rounds up a number to the closest RoundTo Number

  Average rating: 4.5 (30 votes) Log in to vote

Ibrahim Bittar Torres   Ibrahim Bittar Torres - Show more from this author
Eikonsys, S.A. de C.V.

Share on Facebook Share on Twitter

  Sample input:
SuperCeiling ( 678 , 1000 )
SuperCeiling ( 4567 , 10 )
  Sample output:

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

(Updated Nov 28 - 2012):

Sometimes you need to calculate the closest thousand or hundred of a number, specially when you are working with items billable by the thousand (like paper).

Basically this CF divides the number by RoundTo, takes the fractionary part and rounds it up using the Ceiling() function and the adds it to the integer part and multiply it by RoundTo again.



Simon Stock   Simon Stock, Bedfordshire, UK
May 14, 2013
I get a "Specified Parameter Could Not Be Found" error, highlighting "Number" - what does that refer to?
Ibrahim Bittar   Ibrahim Bittar, Leon MX
May 14, 2013
You have to add the parameter in the upper side of the dialog. Type "Number" and click the + icon.
Steve M   Steve M, Broomall, PA
Aug 21, 2015
Works great!, found this after doing it the hard way....:)
hund > 500;0;
hund = 500;-500;
hund ≥ 1 ; 500;
Ibrahim Bittar   Ibrahim Bittar, León MX
Aug 21, 2015
Hi Steve, thank you for your comments.

By the way, it helped me to notice that it was spelled wrongly and I have just fixed it. the calculation remains the same, it was just how it shows on this website.

Don Wieland   Don Wieland, Irvine, CA
Dec 22, 2017
If you want to make the result Round UP or Down, here is a MOD to your CF:

RoundUpDnByUnit ( Number , RoundTo )

Let ( [

a = Number;
b= RoundTo;

Num = a / b ;
Integ = Int ( Num ) ;
Frac = Num - Integ;

c = ( Integ + Ceiling ( Frac ) ) * b;
d = If(a ≥ (c - (b / 2)); c; c - b)

] ;

d )



Log in to post comments.


Note: these functions are not guaranteed or supported by Please contact the individual developer with any questions or problems.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 16 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: