Nesting is the practice of placing one formula or function inside another. The idea is that one function requires a value that can be delivered by another. By nesting a function inside another, and placing the inner function where a function argument would appear, the inner function can pass a result directly to the outer function.
In the example shown, the formula in D4 contains three functions that are nested:
The TODAY function is nested inside of the YEARFRAC function, which is nested inside the INT function. The TODAY function returns the current date, which is passed into the YEARFRAC function as the "end date". The start date is provided by cell C4. YEARFRAC returns a decimal value like this in D4:
18.425// YEARFRAC result on Oct 19, 2019
whis is passed directly the INT function. The INT function removes the decimal portion of the number and returns 18 as a final result.
More examples of nesting
Nesting is a common technique in more advanced Excel formulas. Here are a few more examples:
An Excel function is a pre-built formula with a specific purpose. Excel provides hundreds of functions in various categories like dates and times, text, statistics, lookup, financial, engineering, etc. Most Excel functions require specific inputs,...
A function argument is a specific input to a function. For example, the VLOOKUP function takes four arguments as follows: = VLOOKUP ( value , table , col_index , [ range_lookup ]) Note most arguments are required, but some are optional. In Excel,...
An Excel formula is a way of defining a specific calculation in a worksheet. In Excel, all formulas must begin with an equals sign (=). For example, to add 100 to a value in A1, you can write a formula like this: = A1 + 100 This formula will always...