Skills / Excel and Google Sheets / Formulas and cell references

Excel and Google Sheets, lesson 2 of 9

Formulas and cell references

A formula always starts with =. It can do arithmetic (=B2*C2), or use a function such as =SUM(D2:D50), which adds up every cell from D2 to D50.

Common functions you will use daily:

  • SUM, AVERAGE, MIN, MAX for totals and simple statistics
  • COUNT (cells with numbers) and COUNTA (cells that are not empty)
  • ROUND(value, 2) to round to two decimal places

Relative references. When you copy =B2*C2 from row 2 down to row 3, it becomes =B3*C3 by itself. The references move with the formula. This is what lets you write a formula once and fill it down a thousand rows.

Absolute references. Sometimes one reference must *not* move, for example a tax rate kept in cell F1. Add dollar signs: =D2*$F$1. Copied down, it becomes =D3*$F$1; the F1 stays fixed. Press F4 (in Excel) while the cursor is on a reference to cycle through the options.

Mixed references fix only the column ($F1) or only the row (F$1). They are useful when filling a formula both across and down a grid.

Good habits:

  • Put inputs such as rates and targets in their own labelled cells, never typed inside formulas, so they are easy to change
  • Check a formula by clicking it: the cells it uses are highlighted
  • Read errors calmly: #DIV/0! means dividing by zero or an empty cell; #REF! means a reference points to a deleted cell; #VALUE! means the wrong kind of value, often text where a number was expected
Try it: Make a small price list with Quantity in column B and Price in column C. Put a 10% discount rate in cell F1. Write one formula in D2 for the discounted total that still works when filled down.

Check yourself

1. You copy =B2*C2 down one row. What does it become?

2. Which reference stays fixed on F1 when copied anywhere?

3. What does the #DIV/0! error mean?