# Calculating an Interest Rate

**URL:** <https://forum.bubble.io/t/calculating-an-interest-rate/340495>\
**Category:** Need help\
**Created:** [September 24, 2024, 6:29am UTC](https://forum.bubble.io/t/calculating-an-interest-rate/340495 "2024-09-24T06:29:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![connorholland5](https://avatars.discourse-cdn.com/v4/letter/c/f14d63/32.png) [@connorholland5](https://forum.bubble.io/u/connorholland5)\
**Post date:** [September 24, 2024, 6:29am UTC](https://forum.bubble.io/t/calculating-an-interest-rate/340495/1 "2024-09-24T06:29:48Z")

</div>

Hello! I am fairly experienced in using bubble, but I do not know how to write code and am really struggling to figure out how to make this calculation. I want to determine the interest rate of a loan and I have the monthly payment, number of periods, and loan amount. In excel, this would be done using the =RATE(nper,pmt,pv) function, but I have not figured out any way to do something similar here, even when trying an excel plugin. Any help would be greatly appreciated! Thank you!

---

<div class="post-metadata">

**Author:** ![Qaiser](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/qaiser/32/104621_2.png) [@Qaiser](https://forum.bubble.io/u/Qaiser)\
**Post date:** [September 24, 2024, 6:39am UTC](https://forum.bubble.io/t/calculating-an-interest-rate/340495/2 "2024-09-24T06:39:36Z")

</div>

You can use javascript to calculate. I have done similar stuff in backend workflows. Check the screenshots for better understanding.

 ![image](https://us1.discourse-cdn.com/bubble/original/3X/1/4/1491fce5aed524d58bb665046147e3746411d254.png)  
 ![image](https://us1.discourse-cdn.com/bubble/original/3X/2/0/209a8d33d41fe79b24a45184d6d7000e546fd41d.png)  
 ![image](https://us1.discourse-cdn.com/bubble/original/3X/7/9/79ac7e9d5578716c4d4e7407587ed120ab360cb2.png)

---

<div class="post-metadata">

**Author:** ![connorholland5](https://avatars.discourse-cdn.com/v4/letter/c/f14d63/32.png) [@connorholland5](https://forum.bubble.io/u/connorholland5)\
**Post date:** [September 24, 2024, 3:08pm UTC](https://forum.bubble.io/t/calculating-an-interest-rate/340495/3 "2024-09-24T15:08:11Z")

</div>

Thank you so much for the response! Do you know of a js function that calculates rate similar to the excel one I listed originally?

---

<div class="post-metadata">

**Author:** ![connorholland5](https://avatars.discourse-cdn.com/v4/letter/c/f14d63/32.png) [@connorholland5](https://forum.bubble.io/u/connorholland5)\
**Post date:** [September 24, 2024, 4:04pm UTC](https://forum.bubble.io/t/calculating-an-interest-rate/340495/4 "2024-09-24T16:04:22Z")

</div>

I actually found a function, but now I am having trouble saving it to my database. Here is a picture of the code when I run it online. It gets the correct answer, but when I try to save the result or output 1 in bubble, nothing saves. It just shows up as blank. I have set both the output and the result to be numbers. Thanks!

 ![Screenshot 2024-09-24 at 12.02.31 PM](https://us1.discourse-cdn.com/bubble/original/3X/3/5/352b6fcbf7168b47cb32fe68250b61e88b88898f.png)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/bubble/original/3X/2/8/2847faa74692c2ffa5d939d3dc3724cdd060d247.png) [@system](https://forum.bubble.io/u/system)\
**Post date:** [December 3, 2024, 6:30am UTC](https://forum.bubble.io/t/calculating-an-interest-rate/340495/5 "2024-12-03T06:30:15Z")

</div>

Closed on December 3, 2024, 6:30am UTC

This topic was automatically closed after 70 days. New replies are no longer allowed.
