Function Syntax
A function’s syntax refers to the layout of the function and includes the function’s name, parenthesis, comma separators, and its arguments. The arguments are always surrounded by parentheses and individual arguments are separated by commas. A simple example, shown in the image above, is the SUM function, which can be used to sum or total long columns or rows of numbers. The syntax for this function is: The arguments for this function are:
Number of Arguments
The number of arguments that a function requires varies with the function. The SUM function can have up to 255 arguments, but only one is required — the Number1 argument. The remainder are optional. The OFFSET function, meanwhile, has three required arguments and two optional ones. Other functions, such as the NOW and TODAY functions, have no arguments but draw their data — the serial number or date — from the computer’s system clock. Even though no arguments are required by these functions, the parentheses, which are part of the function’s syntax, must still be included when entering the function.
Types of Data in Arguments
Like the number of arguments, the types of data that can be entered for an argument will vary depending upon the function. In the case of the SUM function, as shown in the image above, the arguments must contain number data, but this data can be:
the actual data being summed - the Number1 argument in the image above an individual cell reference to the location of the number data in the worksheet - the Number2 argument an array or range of cell references - the Number3 argument
Other types of data that can be used for arguments include:
text data Boolean values error values other functions
Nesting Functions
It is common for one function to be entered as the argument for another function. This operation is known as nesting functions and it is done to extend the capabilities of the program in carrying out complex calculations. For example, it is not uncommon for IF functions to be nested one inside the other as shown below. In this example, the second or nested IF function is used as the Value_if_true argument of the first IF function and is used to test for a second condition, if the data in cell A2 is less than 100. Since Excel 2007, 64 levels of nesting are permitted in formulas. Prior to that, only seven levels of nesting were supported.
Finding a Function’s Arguments
Two ways of finding the argument requirements for individual functions are:
Open the function’s dialog box in ExcelTooltip windows in Excel and Google Sheets
Excel Function Dialog Boxes
The vast majority of functions in Excel have a dialog box, as shown for the SUM function in the image above, that lists the required and optional arguments for the function. Opening a function’s dialog box can be done by:
finding and clicking on a function’s name under the Formula tab of the ribbon; clicking on the Insert Function option located next to the formula bar, as indicated in the image above.
Tooltips: Typing a Function’s Name
Another way to find out a function’s arguments in Excel and in Google Sheets is to: In Excel, the tooltip window surrounds optional arguments with square brackets ([ ]). All others listed arguments are required. In Google Sheets, the tooltip window does not differentiate between required and optional arguments. Instead, it includes an example as well as a summary of the function’s use and a description of each argument.