Spreadsheet Syntax User Guide

Content
  1. What is syntax and when do I use it in Excel or Google Sheets?
  2. IF function syntax
  3. Brackets and commas
  4. Reading the syntax of an IF function
  5. Required and Optional Arguments

What is syntax and when do I use it in Excel or Google Sheets?

Function syntax in Excel or Google Sheets refers to the layout and order of the function and its arguments. A function in Excel and Google Sheets is a built-in formula. All functions start with an equal sign (=) followed by the name of the function, such as IF, SUM, COUNT, or ROUND . When you use the correct syntax for functions in Excel or Google Spreadsheets, you avoid error messages.

The instructions in this guide apply to Excel 2019, Excel 2016, Excel 2013, Excel 2010, Excel 2007, Excel Online, and Excel for Mac.

IF function syntax

Function arguments refer to any data or information required by the function. These arguments must be entered in the correct order. For example, the syntax for the IF function in Excel is:

 = IF (Logical_test, Value_if_true, Value_if_false) 

Brackets and commas

In addition to the order of the arguments, the term syntax also refers to the placement of parentheses or parentheses around arguments and the use of a comma as a separator between individual arguments.

Because the IF function syntax requires a comma to separate the three function arguments, do not use a comma for numbers greater than 1000.

Reading the syntax of an IF function

The IF function in Excel and Google Sheets takes three arguments, in the following order:

  • logic test
  • argument value_if_true

  • argument value_if_false

If the arguments are in a different order, the function returns an error message or an unexpected response.

Required and Optional Arguments

One piece of information unrelated to syntax is whether the argument is required or optional. In the case of an IF function, the first and second arguments (Logical_test and Value_if_true arguments) are required. The third argument, the Value_if_false argument, is optional.

If the third argument is omitted in the function, and the condition tested by the function argument Logical_test becomes false, then the function returns the term FALSE in the cell where the function is located.

Leave a Reply

Your email address will not be published. Required fields are marked *