Other Functions as Arguments - MS-Excel Tutorial
Other Functions as Arguments
Because Excel can evaluate expressions as arguments, it should not surprise you that these expressions can include other functions. Writing formulas that have functions within functions is sometimes known as nesting functions. Excel starts by evaluating the most deeply nested expression and works its way out. Note this example of a nested function:
=SIN(RADIANS(B9))
The RADIANS function converts degrees to radians, the unit used by all of the Excel trigonometric functions. If cell B9 contains an angle in degrees, the RADIANS function converts it to radians and then the SIN function computes the sine of the angle.
A formula can contain up to 64 levels of nested functions, up from 7 in previous versions. If you exceed this level, Excel pops up an error message. In the vast majority of cases, this limit poses no problem. In the unlikely event that you need to exceed this limit, you may be able to use a lookup function instead.
Arrays as Arguments
A function can also use an array as an argument. An array is a series of values separated by a comma and enclosed in brackets. The formula below uses the OR function with an array as an argument. The formula returns TRUE if cell A1 contains 1, 3, or 5.
=OR(A1={1,3,5})
Often, using arrays can help you simplify your formula. The formula below, for example, returns the same result but uses nested IF functions instead of an array:
=IF(A1=1,TRUE,IF(A1=3,TRUE,IF(A1=5,TRUE,FALSE)))