

The named range Above will always refer to the cell directly above. Now we can use the formula in our running total column. Go to the File tab > Options the Formula section > uncheck the R1C1 reference style box > then press the OK button. We can now switch Excel back to the default reference style. Add the formula =RC into the Refers to input and press the OK button. Insert a name like “ Above” as the name of the range. Go to the Formula tab of the Excel ribbon and choose the Define Name command. Go to the Formula section in the Excel Options menu and check the R1C1 reference style box and then press the OK button. To switch reference style, go to the File tab then choose Options.

We can use this relative referencing to create a named range that’s always one cell above the referring cell with the formula =RC. For example, =RC refers to the cell 2 up and 3 to the right of the cell using this formula. In R1C1 reference style, cells are referred to by how far away they are from the cell using the reference. Then switching the reference style back to A1. Then defining a named range using the R1C1 notation. This is a trick that involves temporarily switching the Excel reference style from A1 to R1C1. This will refer to the cell directly above no matter how many rows we insert or delete. We can avoid the problems with inserting and deleting rows from our data if we use a relative named range. Running Totals with a Relative Named Range Unfortunately, this too will have the same problems (and solutions) with inserting or deleting rows.

It won’t reference any column headings and the range referenced will grow to each row. If we use the following formula =SUM($C$3:C3), we can copy and paste this down the range. Running Totals with a Partially Fixed RangeĪnother option with the SUM function is to only reference the Sales column and use a partially fixed range reference. We can fix them the same way as with running totals in the simple formula method. When inserting or deleting rows, we will still encounter the same problems with blank cells and errors. This formula will reference the column heading containing text for the first row, but this ok as it’s treated like a 0. This way we can use the following formula uniformly for every row including the first row. When the SUM function encounters a text cell it will treat it the same as a though it contained a 0. We can avoid the awkwardness of using two different formulas in our running total column by utilizing the SUM function instead of the + operator. To fix this, we’ll need to copy the formula down from the last error-free cell all the way down to the last row. To fix this, we’ll need to copy the formula down from the first cell above the newly inserted rows all the way down to the last row.ĭeleting any rows will result in #REF! errors since deleting a row means deleting a cell referenced by the formula below it. Inserting a new row will result in a gap in the running total.

What happens to the running total when we insert or delete rows in our data? We avoid this with a different formula in the first row which doesn’t reference the cell above. This would cause a #VALUE! error to appear in the running total since the + can’t handle text values. The formula in our first row can’t add the cell above it to the total as it contains a text value for a column heading.
How to calculate subtotals in excel download#
Download Example File Running Totals with a Simple Formula
