Counting account balance

When you make accounting postings for an account and after the period, you want to check the balance of an account. You need to count both debit and credit side. If sum for debit side postings is higher than sum of credit, then you need to add the difference to credit side to match both debit and credit sides. In this case the account has debit balance.

The formulas presented are in cells F16 and G16. If you want to copy paste the if sentences, they are here:

=IF(SUM(G4:G14)>SUM(F4:F14);SUM(G4:G14)-SUM(F4:F14);””)

=IF(SUM(F4:F14)>SUM(G4:G14);SUM(F4:F14)-SUM(G4:G14);””)

If formula in debit side checks first if sum for credit postings is higher than sum of debit postings, in this case, the difference between credit and debit is counted. If the if sentence is not true, sum of debit postings is higher than credit postings, then the cell should be blank, as in that case we have credit balance.