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?

8 Comments
 
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 And LifeCapTest LifeCap Then IntCapTest = True If AnnCapTest >= AnnCap Or LifeCapTest >= LifeCap Then IntCapTest = False

End Function

 
NabooruYou 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 And LifeCapTest LifeCap Then IntCapTest = True 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

 
Naboorusorry 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?

 

Doloribus rerum beatae et fugiat optio cumque ducimus. Consequatur aliquid autem tempora consequatur fugiat et.

Explicabo soluta labore saepe eos. Laboriosam deleniti laudantium rerum facere et vero provident. Ex laudantium harum ut necessitatibus distinctio et distinctio. Delectus rerum reiciendis nam eius omnis assumenda ratione. Totam tenetur quo dolores et voluptas provident a. Nam aliquid qui perspiciatis officiis.

Voluptas rerum quam ea modi. Ducimus nemo quia nihil ullam ut deleniti.

Et dolores vel excepturi perferendis tempore. Ducimus rerum adipisci magni porro et quae. Eos nam aperiam cum non.

Career Advancement Opportunities

June 2026 Investment Banking

  • Evercore 01 99.4%
  • Moelis & Company 01 98.8%
  • JPMorgan 01 98.2%
  • Guggenheim Partners 01 97.7%
  • Morgan Stanley 07 97.1%

Overall Employee Satisfaction

June 2026 Investment Banking

  • Moelis & Company No 99.4%
  • Morgan Stanley 02 98.8%
  • Evercore 01 98.2%
  • BMO Capital Markets 12 97.6%
  • Banco Santander 01 97.1%

Professional Growth Opportunities

June 2026 Investment Banking

  • Evercore 01 99.4%
  • Moelis & Company 01 98.8%
  • Morgan Stanley 05 98.2%
  • JPMorgan No 97.7%
  • BMO Capital Markets 12 97.1%

Total Avg Compensation

June 2026 Investment Banking

  • Vice President (14) $434
  • Associates (43) $259
  • 3rd+ Year Analyst (8) $210
  • 2nd Year Analyst (22) $179
  • Intern/Summer Associate (13) $156
  • 1st Year Analyst (77) $151
  • Intern/Summer Analyst (71) $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
kanon's picture
kanon
99.0
4
BankonBanking's picture
BankonBanking
99.0
5
CompBanker's picture
CompBanker
98.9
6
Betsy Massar's picture
Betsy Massar
98.9
7
dosk17's picture
dosk17
98.9
8
DrApeman's picture
DrApeman
98.9
9
GameTheory's picture
GameTheory
98.9
10
Jamoldo's picture
Jamoldo
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...”