I have a spreadsheet that lists checks and deposits in chronological sequence
and keeps a running balance of the account. Is there a function to calculate
the average daily balance for a selected range of dates?
Don't forget to track when interest is paid to the account.
If you have transactions (checks/withdrawals and deposits) almost
daily, it might make sense to track the ending balance of every day,
even if there is no transaction on that day. (Note that weekends
count as a day.) In that case, simply use AVERAGE(B1:B31) to compute
the average daily balance, assuming B1:B31 contains the ending balance
of a 31-day month, for example.
If you have relatively few transactions per period, the average daily
balance is the sum of the each new balance times the number of days
that balance remains unchanged, all divided by the total days.
Assuming transactions are in consecutive rows, the average daily
balance can be computed as follows:
=sumproduct(A2:A11 - A1:A10, B1:B10) / (A11-A1)
That assumes you always have a "transaction" on the first and last
dates of the period, even if there is actual transaction. A1:B1 is
the end date and balance of the previous period; A10:B10 is the end
date and balance of the current period; and A11 is the start date of
the next period.