formula for average daily balance

bhmcpfs

Board Regular
Joined
Apr 1, 2002
Messages
106
Am trying without success to create a formula to calculate average daily balance from a ledger that has a variable amount of entries per month. The variability of # of entries has me stumped. For example:

date, amount
1/1/2005, 10
1/5/2005, 1
1/10/2005, 4.65
1/18/2005, 7
1/22/2005, 20

Aver Daily Bal = 23.78. and I can get this easily manually, but I'd like a more automated solution. I'm trying a sumproduct angle, to no avail. Thanks in advance...
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
bhmcpfs said:
Am trying without success to create a formula to calculate average daily balance from a ledger that has a variable amount of entries per month. The variability of # of entries has me stumped. For example:

date, amount
1/1/2005, 10
1/5/2005, 1
1/10/2005, 4.65
1/18/2005, 7
1/22/2005, 20

Aver Daily Bal = 23.78. and I can get this easily manually, but I'd like a more automated solution. I'm trying a sumproduct angle, to no avail. Thanks in advance...

How did you get 23.78?
 
Upvote 0
23.78 is the average of the daily account balance. The sum is 737.30 (of the account balance each day), divided by 31 days (in January).
 
Upvote 0
Array entered,

=AVERAGE(IF(DATE(YEAR(A2:A20),MONTH(A2:A20),1)=B1,B2:B20))

Where B1 houses the first day of the month of interest, i.e. 1/1/2005. You can either use a dynamic named range or have the range include more rows than you'd need.

For a dynamic named range, go to Insert/Name/Define enter a name, then in the Refers to enter,

=$A$2:INDEX($A:$A,MATCH(9.9999999999999E+307,$A:$A))

And use the name in the formula, instead of the row/column
 
Upvote 0
Thanks Brian. Will try your formula with named ranges. Hopefully I can make this work, as it needs to be done monthly.

Bubbis, just using AVERAGE will not work, as there are missing days that need to be averaged.

Can I have dynamic named ranges based off other dynamic named range? (e.g. Feb start range will be dependent on Jan end range)
 
Upvote 0
Does this do it?

I'm assuming that you know the ranges and that you don't want the formula to identify those for you but only to do the calculation - perhaps that isn't right....

Assumes that all dates in A are in the same month

Formula in a9 is an array formula to be entered with CTRL+SHIFT+ENTER

=((EOMONTH(A2,0)+1)*SUM(B2:B6)-SUM(A2:A6*B2:B6))/DAY(EOMONTH(A2,0))

EOMONTH requires Analysis ToolPak
days&months.xls
ABCD
1
201/01/200510
305/01/20051
410/01/20054.65
518/01/20057
622/01/200520
7
8
923.78
10
Sheet3
 
Upvote 0
Checkbook register.xls
CDEFGH
3DateDescCDebit(-)Credit(+)Balance
41/1/2005InitialDeposita$10.00$10.00
51/5/2005Deposita$1.00$11.00
61/10/2005Deposit$4.65$15.65
71/18/2005Deposit$7.00$22.65
81/22/2005Deposit$20.00$42.65
91/31/2005Interest$1.18$43.83
Sheet1


Man, hope I got this right. Am trying to post small sample via HTML Maker. Had problems installing, running, etc. If this doesn't work, my apologies in advance. I'm looking for formula to calculate interest credit in G9. This will probably have to come from elsewhere in the file.

Barry - EOMONTH should be helpful as well

Bubbis - 10,10,10,10,11,11,11,11,11,15.65,15.65,15.65 these are the first 12 days used in calculating the aver daily balance in my sample data. Account balance for each day should be summed for the month, then averaged.
 
Upvote 0
Incorporating Brian's logic with my earlier formula (I hope you don't mind, Brian) - Does this help?

Array formula (to be confirmed with CTRL+SHIFT+ENTER) in E7 is

=IF(D7="int",(SUM(IF(DATE(YEAR(C$2:C6),MONTH(C$2:C6)+1,0)=C7,E$2:E6*(C7-(C$2:C6)+1),0)))/DAY(C7)*H1,"")

C7 must contain last day of the month of in question

H1 contains monthly interest

Formula can be copied down - while column D does not contain "int" blank will appear.
days&months.xls
CDEFGH
1DepositsBalanceMonthly Interest5%
201/01/2005Initial Dep$10.00$10.00
301/05/2005Dep$1.00$11.00
401/10/2005Dep$4.65$15.65
501/18/2005Dep$7.00$22.65
601/22/2005Dep$20.00$42.65
701/31/2005Int$1.19$43.84
8 
average for month
 
Upvote 0

Forum statistics

Threads
1,223,627
Messages
6,173,425
Members
452,515
Latest member
Alicedonald9

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top