Sub topic 1
Writing Your First Excel Formula with Arithmetic Operators
Prerequisites
This chapter assumes you can open a workbook, select a cell, type a value, and press Enter. You should also know basic arithmetic and the usual order of operations.
Cells and their addresses
An Excel worksheet is a grid of cells. Each cell has an address made from its column letter and row number. For example, B2 is the cell in column B and row 2. The address D5 identifies a different cell.
A cell can hold text, a number, or a formula. A formula is an instruction that calculates a result. Using cell addresses lets a formula use values that may change later.
Your first formula: starting with =
Every Excel formula starts with an equals sign (=). Select a cell, type a formula, and press Enter. Excel calculates the result and displays it in the cell.
=2+3The cell displays 5. To inspect or change the formula, select the cell and look in the formula bar. You can also select the cell, press F2, edit the formula, and press Enter.
A formula can refer to another cell:
=B2This displays the current value in B2. If the value in B2 changes, the result updates.
Adding, subtracting, multiplying, and dividing
Excel uses these arithmetic operators:
| Operation | Operator | Example |
|---|---|---|
| Addition | `+` | `=8+2` |
| Subtraction | `-` | `=8-2` |
| Multiplication | `*` | `=8*2` |
| Division | `/` | `=8/2` |
For example, if B2 contains a unit price and C2 contains a quantity, calculate the line total with:
=B2*C2This formula is better than typing the numbers directly because it recalculates when either cell changes.
When a divisor is zero or empty, Excel cannot calculate the division and returns #DIV/0!. Check the referenced cells before changing the formula.
Exercise
If B2 contains 12 and C2 contains 4, which formula calculates B2 minus C2?
Show answer
=B2-C2, which returns 8.