When you need to change a formula, either the calculation or the referenced cells, you can edit the formula in the Formula bar or in the cell.
To edit in the Formula bar, click the cell that contains the formula, and then click anywhere in the Formula bar. Use regular text-editing techniques to edit the formula—click-and-drag to select characters you want to change; then delete or type over them. Press Enter to complete the formula.