A formula in calc to reduce a loan amount

I have loaned some money to a family member and want to keep track of the repayments, when I enter the amount repaid I would like the amount outstanding to reduce by that amount, is there a function that will let me do that?

Many thanks

e.g.