This concept is similar to having database which can be done in Excel if you keep a record of all the transaction.
1. You build a separate sheet with all your transactions with a label for Debit and Credits.
2. On your [Summary] page, you just calculation your balance based on Debit and Credits.