Excel Table Formulas- First Row Different

July 20, 2024 (3 months ago)
Excel

The Issue:

I have a calculated column in a table, and the first cell in the column needs to be unique.

Why? The column is essentially a running total.

The first cell, though needs to start with an existing balance – from another cell.

Here’s an example:

A B
1 amount total
2 5 7
3 3 10

So, cells in column A are entered by the user.

The formula for cell B2 is =B2+{number from another cell}

The formula for cell B3 is =B3+B2.

The issue is that when I add another row, the formula in B4 will be the same as B2, due to the way Excel assigns default formulas.

And my extensive search turned up nothing reasonably simple.

Here’s my solution: (yes, it’s kind of a hack, but it works)

A B C
1 row amount total
2 2 5 7
3 3 3 10

So, the formula for Column A is: =ROW(), which just outputs the row number.

The formula for column C is: =IF(A2=2, C2+{number}, C2+C1)

A simple IF statement – if it’s row 2, use the first formula. Otherwise, use the second.

Voila!