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?

 

Qui ut sit qui repellat earum. Nihil assumenda adipisci in optio modi nesciunt. Sequi tempora est vel. Inventore eveniet voluptatem ad consectetur voluptas necessitatibus.

Alias provident sit earum quo ipsa. Expedita laboriosam enim quam sed iure eos. Asperiores voluptates rerum dicta aut. Aliquam placeat architecto dolores sint. Sit rerum accusamus quis reprehenderit et.

Eum asperiores voluptatibus autem facilis aspernatur omnis iusto. Est ut eos sed. Repellendus eius atque eligendi possimus id. Deleniti enim assumenda corrupti aut commodi veniam nostrum molestias.

Career Advancement Opportunities

July 2026 Investment Banking

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

Overall Employee Satisfaction

July 2026 Investment Banking

  • Moelis & Company No 99.4%
  • Evercore No 98.8%
  • Morgan Stanley 01 98.3%
  • BMO Capital Markets 13 97.7%
  • Banco Santander 01 97.1%

Professional Growth Opportunities

July 2026 Investment Banking

  • Evercore 01 99.4%
  • Moelis & Company 01 98.9%
  • Morgan Stanley 06 98.3%
  • Goldman Sachs 01 97.7%
  • JPMorgan 01 97.1%

Total Avg Compensation

July 2026 Investment Banking

  • Vice President (15) $434
  • Associates (46) $258
  • 3rd+ Year Analyst (8) $210
  • 2nd Year Analyst (22) $179
  • Intern/Summer Associate (13) $156
  • 1st Year Analyst (80) $150
  • Intern/Summer Analyst (73) $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
BankonBanking's picture
BankonBanking
99.0
4
kanon's picture
kanon
99.0
5
dosk17's picture
dosk17
98.9
6
DrApeman's picture
DrApeman
98.9
7
Betsy Massar's picture
Betsy Massar
98.9
8
GameTheory's picture
GameTheory
98.9
9
CompBanker's picture
CompBanker
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...”