Operators

The operators that can be used in Excel formulas span the entire range of commonly used symbols. These operators are listed in this section, with the most frequently used described first.

Arithmetic operators are used for basic calculations and return numeric values. Table 3-1 lists the arithmetic operators used in Excel formulas.

You create formulas in Excel worksheets by using these operators and entering the formulas directly into a cell. After you enter a formula, the result is displayed in the cell and the formula is shown as the cell content in the formula bar.

Use the comparison operators to compare values, text, or cells. These expressions are often used in logical functions; a common example is IF(). The result is always a logical value (Boolean value). Table 3-4 lists all of the Boolean operators and illustrates them with sample formulas.

In some cases, you might want to combine the results from several formulas or cells in a single cell. For this task you use the & (ampersand) operator. If you connect two values of any type with the ampersand, the result always has the Text data type. In other words, Excel converts number values automatically into text. This way you can use the text operator to include two number values as text in one cell. However, you cannot use the resulting string directly for other calculations.

To connect the content in cells A1 and A2 by using the text operator, use the following formula:

=A1&A2

The text operator connects the contents of the two cells without a space in between them. To include a space between the values, you must use quotation marks. If you want a space between the values in cell A1 and cell A2, use the following formula:

=A1&" "&A2

With reference operators, you can pass cells or cell ranges to a formula or function for calculation. The following operators are available:

If you want to reference columns or rows from the first to the last cell, use the references listed in Table 3-5. You can create references for other columns and rows based on the references in this table.