Filling a formula down
A monthly orders export has five hundred rows, and each one needs an amount: the price multiplied by the quantity. Writing the formula for the first row doesn't take long. But typing it in another 499 times would take until evening.
You don't need to write it again at all. Excel copies a formula to neighboring cells with one mouse movement, and this is called filling.
The fill handle
You drag the fill handle: the small square in the bottom right corner of the selection border. The table below has five orders, and the formula is already in the first row, in D2.
- Select the cell with the formula.
- Point to the fill handle: the pointer turns into a thin cross.
- Hold down the mouse button and drag down to the last row of the table.
Filled formulas stay formulas. If the price changes in any row, that row's amount recalculates by itself.
Dragging down five hundred rows takes a while. Instead, double-click the fill handle: Excel fills the formula down to the end of the table by itself. It finds the end by looking at the neighboring column with data.
A formula remembers the path, not the address
After filling, D2 has =B2*C2, and D3 already has =B3*C3. This isn't a mistake. Excel doesn't remember the addresses themselves, but where they are relative to the cell with the formula.
For D2, =B2*C2 means: "take the cell two columns to the left and multiply it by the cell one column to the left." From any other row, this path leads to the price and quantity of that row's item:
Addresses like these are called relative references. Thanks to them, one formula works for the whole table, no matter how many rows it has.
You can also fill to the right when the data runs across columns. The path in the formula is kept the same way, only now the letters in the addresses change, and the row numbers stay. For example, the formula =B2+B3 from column B, filled one column to the right, becomes =C2+C3.