Dynamic Compound Interest Formula

plkdti

New Member
Joined
Nov 30, 2021
Messages
1
Office Version
  1. 365
Platform
  1. MacOS
Apologies if some iteration of this question has already been asked, but I wasn't able to find an exact analogue to my situation.


I'd like to create a formula that calculates compound interest on a note based on user inputs for: (i) principal, (ii) annual interest rate, (iii) interest accrual period (three choices--annual/monthly/daily), (iv) day count basis (three choices--Actual/Actual (or just leaving it blank), Actual/360, Actual/365), (v) interest start date, and (vi) interest end date.


My current formula is:
=IFERROR( [Principal] * (POWER(1 + ( [Annual Interest Rate] / IFERROR( IFS( [Interest Accrual Period] ="Monthly", 12, [Interest Accrual Period] = "Daily", IF( [Day Count Basis] = "Actual/360", 360, 365), [Interest Accrual Period] = "Annual",1),1)),YEARFRAC( [Start Date] , [End Date], IFS(ISBLANK([Day Count Basis]),1,[Day Count Basis]="Actual/360",2,[Day Count Basis]="Actual/365",3))*IFERROR(IFS([Interest Accrual Period]="Monthly",12,[Interest Accrual Period]="Daily",IF([Interest Accrual Period]="Actual/360",360,365),[Interest Accrual Period]="Annual",1),1)))-[Principal]A2,0)


I know my formula is not properly accounting for leap years--so any suggestions on that would be great. But also looking to see if there are any problems with the rest of the formula. Not 100% the YEARFRAC function is doing what I want it to do.


Really appreciate your help!

Sample.xlsx
CDEFGHI
63PrincipalInterest RateInterest Accrual PeriodDay Count BasisStart DateEnd DateInterest
64$ 1,700,000.004% Daily Actual/3601/1/201/1/22$ 143,831.90
Pro Forma
Cell Formulas
RangeFormula
I64I64=IF($C$5=1,IFERROR(C64*(POWER(1 + (D64/IFERROR(IFS(E64="Monthly",12,E64="Daily",IF(F64="Actual/360",360,365),E64="Annual",1),1)),YEARFRAC(G64,H64,IFS(ISBLANK(F64),1,F64="Actual/360",2,F64="Actual/365",3))*IFERROR(IFS(E64="Monthly",12,E64="Daily",IF(F64="Actual/360",360,365),E64="Annual",1),1)))-C64,0))
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
The correct calculation depends on the legal contract and law in your jurisdiction.

T202111a.xlsm
CDEFGHI
62
63PrincipalInterest RateInterest Accrual PeriodDay Count BasisStart DateEnd DateInterest
641,700,000.000.04 Daily Actual/36001-01-2001-01-22140,924.86
65
66731
672
68$1,841,781.76
69$1,838,720.00
70$1,840,924.86
71
72
6a
Cell Formulas
RangeFormula
I64I64=IF($C$5=1,IFERROR(C64*(POWER(1 + (D64/IFERROR(IFS(E64="Monthly",12,E64="Daily",IF(F64="Actual/360",360,365),E64="Annual",1),1)),YEARFRAC(G64,H64,IFS(ISBLANK(F64),1,F64="Actual/360",2,F64="Actual/365",3))*IFERROR(IFS(E64="Monthly",12,E64="Daily",IF(F64="Actual/360",360,365),E64="Annual",1),1)))-C64,0))
I66I66=H64-G64
I67I67=DATEDIF(G64,H64,"y")
I68I68=FV(D64/365,I66,0,-C64,1)
I69I69=FV(D64,2,0,-C64,1)
I70I70=FV(D64,YEARFRAC(G64,H64,2),0,-C64,1)
 
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,191
Members
452,616
Latest member
intern444

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