It also doesn’t really make that much sense as to why you’d have missing values in rows, where the whole point is storing credit/debit in each row.
In any case, I also think you’d be better served by a PTA software (Plain Text Accounting), like hledger or something. The advantage is that you can just type out the things, and it’ll calculate daily, monthly and various other charts by itself.
It’s a tradeoff, the more specialty you want, the more complex your functions will be. I’ve a Scooty expenses tracker which tracks my mileage, cost of fuel etc on a per-row basis. If I have to include some service or something, I just remove the formula for the next row. Later on, you can use a filter to filter out blank values and get a steady stream of values you want/need.