Name: BRND Syntax: (BRND(arg1,arg2,arg3))
Family: Function Category: Arithmetic and Mathematical
Description: Bankers Round

Syntax: (BRND(arg1,arg2,arg3))

The first argument of the function is the number to be rounded.

The second argument is the total number of digits to return in the result. You can just leave this at 15, for example, if you want to return all digits.

The third argument of the function indicates where to round. This is the one that is often hard to figure out. It is easiest to think of this argument as the number of zeros or places to keep and then round the next place.

For example, .001, is two places or zeros to keep and then the next number to the right is rounded. 1000 is three places or zeros to keep and then the next number to the left is rounded.

You can easily see this by looking a series of BRND functions:

The starting number is 1234567.76543

(BRND(1234567.76543,15,0.0001)) 
returns 1234567.7654
(BRND(1234567.76543,15,0.001))
returns 1234567.765
(BRND(1234567.76543,15,0.01))
returns 1234567.77
(BRND(1234567.76543,15,0.1))
returns 1234567.8
(BRND(1234567.76543,15,1.))
returns 1234568.
(BRND(1234567.76543,15,10.))
returns 1234570.
(BRND(1234567.76543,15,100.))
returns 1234600.
(BRND(1234567.76543,15,1000.))
returns 1235000.
(BRND(1234567.76543,15,10000.))
returns 1230000.

The BRND function does what is called Banker's Rounding. If the number to be rounded is even at the rounding digit, then the number is not rounded. If the digit is odd, then the number is rounded.

Look at an example rounding to two decimal places.

BRND(1234567.765,15,0.01) returns 1234567.76

BRND(1234567.775,15,0.01) returns 1234567.78

The odd number, .775, is rounded, the even number, .765, is not.

The digit that is used to test odd or even is the digit at the rounding location, in this case the number two decimal places to the right.

Valid data types: REAL, DOUBLE, or CURRENCY.

BRND function has been enhanced to handle very small as well as very large values.

Examples of using BRND function when using very small and very large values:

(BRND(0.01,6,0.01)) 
returns 0.01
(BRND(1.009,6,0.01)) 
returns 1.01
(BRND(0.009,6,0.01)) 
returns 0.01
(BRND(1999,6,1000)) 
returns 2000
(BRND(999,6,1000)) 
returns 1000