How to Write Excel Formulas
A formula is a math calculation, like 2 + 2 or 3(4 + 1). In Microsoft Excel, formulas are different from regular text in two ways:
They begin with an equal sign, like this: =2+2
They don’t contain text (except for function names and cell references). They contain only symbols that are allowed in math formulas, such as parentheses, commas, and decimal points.
Just like in basic math, formulas are calculated by using an order of precedence. The following table lists the order.
|Order of Precedence in a Formula|
|1||Anything in parentheses||=2*(2+1)|
|3||Multiplication and division||=1+2*2|
|4||Addition and subtraction||=10–4|
One of Excel’s best features is its ability to reference cells in formulas. When a cell is referenced in a formula, whatever value it contains is used in the formula. When the value changes, the result of the formula changes, too.
For example, suppose that you enter 7 in cell A1 and 8 in cell A2. Then in cell A3, you put the following formula: =A1+A2
The result of that formula appears in cell A3 as 15. You could have just as easily entered =7+8 in cell A3 and gotten the same result. However, because you reference the cells — rather than the fixed values — you can modify the result by changing what either A1 or A2 contains. For example, if you change the value in A1 to 4, the result in A3 changes to 12.
You can use a formula to repeat a value between one cell and another. For example, the formula =A1 repeats whatever value is in cell A1 wherever you put it.
You can combine cell references with fixed numbers in cells, too. Here are some examples: