Use the fill handle (a small square at the bottom-right corner of the cell) to drag the formula across the desired range of cells. Excel adjusts relative references automatically.