Shopping Cart

Search:

Signup

Contact

FileMaker is a registered trademark of FileMaker, Inc. in the U.S. and other countries.

# FileMaker Pro Custom Functions

Bin ( number ; binNames ; binSizes )

Rate this function:

Discuss this Custom Function

Michael Horak, *COMMENT Visual Realisation
http://comment.cjb.net

Returns the name of the bin containing the number.

Sample Input:
 Bin ( 150 ; List ( "Introduction" ; "First Part" ; "Coffee Break" ; "Second Part" ; "Lunch" ; "Questions" ) ; List ( 15 ; 45 ; 20 ; 60 ; 90 ; 45 ) )
Sample Output:
 "Lunch" indicating that the 150th minute of the event occurs during the lunch break.

Then copy & paste into FileMaker Advanced's Edit Custom Function window.

## Description:

The Bin() function takes a list of bins and their respective sizes and returns the name of the bin containing the given number. For example, given a list of chapters and their page counts, Bin() can calculate which chapter contains the given page number.

Bins are consecutive intervals presumed to start at zero. Each bin can have an arbitrary positive size assigned to it. A boundary value is considered to be contained by the next higher bin; for example:

Bin (
.5 ;
List ( "First Half" ; "Second Half" ) ;
List ( .5 ; .5 )
)

returns "Second Half".

The Bin() function can be used to generate a discrete random value, drawn from a set of possible outcomes with the probability of each outcome separately specified. For example, given a population with the following blood type distribution:
• O: 45%;
• A: 40%;
• B: 11%;
• AB: 4%

you can use =

Bin (
Random ;
List ( "O" ; "A" ; "B" ; "AB" ) ;
List ( .45 ; .4 ; .11 ; .04 )
)

repeatedly to generate a representative sample of the population.

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

This is my Custom Function and I want to edit it