# Formula to cumulatively add and subtract two columns

Formula to cumulatively add and subtract two columns. I have a column for deposit and another for expenditures. Looking to have another Glide column showing the cumulative balance. Many thanks

What do you mean by â€ścumulatively add and subtractâ€ť? Wouldnâ€™t the balance be equal to deposit minus expense?

In that case, you can use a math column.

I think a couple of rollup columns are needed here

1 Like

If itâ€™s for the â€śtotalâ€ť balance then it makes sense. Have a rollup to sum all deposits, a rollup to sum all expenses, and a math column to calculate the final balance by sum deposits minus sum expenses.

Thanks for the response. The rollup and math columns work but provide only one value. Am looking to have a value on each row. Such as the screen shot below

Do you store any identifiable values in those rows, letâ€™s say a userâ€™s ID or email? It would be a bit difficult and might involve JavaScript, so I want to make sure I understand the full structure here.