Interest rate cap/floors with excel-help me plz

For all you excel monkeys out there I could use some help.

I'm currently trying to create a function that checks if a given interest rate is within both an annual (change from last year) and lifetime cap.

Annual cap is 1% lifetime cap is 5% (beginning interest rate is 6.75%).

I tried an IF statemetn and that turned into a black hole. Also messed around with a MAX and MIN function to no avail...

Ideas?

 
Best Response

You can also use a custom function...pull up VBA (alt+f11), insert a new module into your worksheet, and paste this in

Function IntCapTest(IntBegin As Double, IntPrior As Double, IntCurrent As Double) As Boolean

'Created by Nabooru ' 'This is a custom funtion used to check if a given interest 'rate is within both an annual and lifetime cap. The function 'uses 3 inputs: the beginning interest rate, the prior 'period interest rate, and the current interest rate.

Dim AnnCap As Double Dim LifeCap As Double

'Declare max variations

AnnCap = 0.01 LifeCap = 0.05

Dim AnnCapTest As Double Dim LifeCapTest As Double

'Determine actual veriation (abs. value variation)

AnnCapTest = Abs((IntCurrent - IntPrior) / IntPrior) LifeCapTest = Abs((IntCurrent - IntBegin) / IntBegin)

'Test whether abs. value of variation is within the declared 'Cap and return true/false accordingly

If AnnCapTest = AnnCap Or LifeCapTest >= LifeCap Then IntCapTest = False

End Function

 
Nabooru:
You can also use a custom function...pull up VBA (alt+f11), insert a new module into your worksheet, and paste this in

Function IntCapTest(IntBegin As Double, IntPrior As Double, IntCurrent As Double) As Boolean

'Created by Nabooru ' 'This is a custom funtion used to check if a given interest 'rate is within both an annual and lifetime cap. The function 'uses 3 inputs: the beginning interest rate, the prior 'period interest rate, and the current interest rate.

Dim AnnCap As Double Dim LifeCap As Double

'Declare max variations

AnnCap = 0.01 LifeCap = 0.05

Dim AnnCapTest As Double Dim LifeCapTest As Double

'Determine actual veriation (abs. value variation)

AnnCapTest = Abs((IntCurrent - IntPrior) / IntPrior) LifeCapTest = Abs((IntCurrent - IntBegin) / IntBegin)

'Test whether abs. value of variation is within the declared 'Cap and return true/false accordingly

If AnnCapTest = AnnCap Or LifeCapTest >= LifeCap Then IntCapTest = False

End Function

Thanks a ton man!

I inserted this into a new module, how do I go about applying this to my finally payrate cell each year? Also, I should have mentioned the function needs to return the what the interest rate for the current year will be taking into account the caps and floors. Sorry for the dumb questions and thanks again for writing that.

 

sorry it's a bit hard to visualize this w/o seeing the spreadsheet but once you put the code into the module you can go into the worksheet and use it like a normal function, i.e. type in =IntCapTest([beginning interest rate here],[prior year interest rate here],[current rate here]) as if you were using a normal built-in Excel formula. hope that helps; otherwise I should show you from a sample

 
Nabooru:
sorry it's a bit hard to visualize this w/o seeing the spreadsheet but once you put the code into the module you can go into the worksheet and use it like a normal function, i.e. type in =IntCapTest([beginning interest rate here],[prior year interest rate here],[current rate here]) as if you were using a normal built-in Excel formula. hope that helps; otherwise I should show you from a sample

got it, thanks.

Any insight on how I would go about altering this to return what the interest rate for the year needs to be given the cap and floor limitations?

 

Yes, for the lifetime cap I think it would be a variance, e.g. between 1.75% and 11.75%.

Maybe this will help. Here's what I'm looking at in excel

A1: Index rate(fluctuates) + A2: 1.25(margin) = A3:Contract Interest rate(annual & lifetime caps need to be applied here).

EX:

4.00% + 1.25% = 5.25%; last period IR was 6.75%, therefore cell A3 needs to return 5.75% (1% annual cap)

that help?

 

Et omnis est repellendus a occaecati aut sint. Vero quia eligendi est expedita nemo qui. Ut ut et veritatis ad.

Career Advancement Opportunities

March 2024 Investment Banking

  • Jefferies & Company 02 99.4%
  • Goldman Sachs 19 98.8%
  • Harris Williams & Co. (++) 98.3%
  • Lazard Freres 02 97.7%
  • JPMorgan Chase 03 97.1%

Overall Employee Satisfaction

March 2024 Investment Banking

  • Harris Williams & Co. 18 99.4%
  • JPMorgan Chase 10 98.8%
  • Lazard Freres 05 98.3%
  • Morgan Stanley 07 97.7%
  • William Blair 03 97.1%

Professional Growth Opportunities

March 2024 Investment Banking

  • Lazard Freres 01 99.4%
  • Jefferies & Company 02 98.8%
  • Goldman Sachs 17 98.3%
  • Moelis & Company 07 97.7%
  • JPMorgan Chase 05 97.1%

Total Avg Compensation

March 2024 Investment Banking

  • Director/MD (5) $648
  • Vice President (19) $385
  • Associates (86) $261
  • 3rd+ Year Analyst (13) $181
  • Intern/Summer Associate (33) $170
  • 2nd Year Analyst (66) $168
  • 1st Year Analyst (202) $159
  • Intern/Summer Analyst (144) $101
notes
16 IB Interviews Notes

“... there’s no excuse to not take advantage of the resources out there available to you. Best value for your $ are the...”

Leaderboard

1
redever's picture
redever
99.2
2
Secyh62's picture
Secyh62
99.0
3
Betsy Massar's picture
Betsy Massar
99.0
4
BankonBanking's picture
BankonBanking
99.0
5
kanon's picture
kanon
98.9
6
CompBanker's picture
CompBanker
98.9
7
dosk17's picture
dosk17
98.9
8
DrApeman's picture
DrApeman
98.9
9
GameTheory's picture
GameTheory
98.9
10
bolo up's picture
bolo up
98.8
success
From 10 rejections to 1 dream investment banking internship

“... I believe it was the single biggest reason why I ended up with an offer...”