Hi,
I am building a website that allows consumers to calculate their borrowing power for a specific mortgage product. However part of the formula is beyond my understanding of math to develop the formula. Thanks to anyone who could!
Part of the fees that are charged on this program is a Title Insurance Fee. It is based on the Home Purchase Price and is calculated on the sliding scale below:
The first \$10,000 of the Home Purchase Price is charged a base fee of: \$220.00
The next portion of the Home Purchase Price value between \$10,000-\$50,000 is multiplied by 0.004318
The next portion of the Home Purchase Price value between \$50,000-\$100,000 is multiplied by 0.005143
The next portion of the Home Purchase Price value between \$100,000-\$200,000 is multiplied by 0.004675
The next portion of the Home Purchase Price value between \$200,000-\$500,000 is multiplied by 0.00374
The last portion of the Home Purchase Price value between \$500,000-\$2,000,000 is multiplied by 0.00187
(Because of loan limits for this program, there will never be Home Purchase Price values over \$2,000,000)
Once the different portions of the Title Policy Fee is calculated and added together the result is then multiplied by 1.7818
Example: If the Home Purchase Price is \$426,000 the Title Insurance Fee would be calculated as follows:
\$220 base fee for the first \$10,000 of the \$426,000 Home Purchase Price
\$172.72 (\$40,000 x 0.004318) is added for the next \$40,000 of the \$426,000 Home Purchase Price
\$257.15 (\$50,000 x 0.005143) is added for the next \$50,000 of the \$426,000 Home Purchase Price
\$467.50 (\$100,000 x 0.004675) is added for the next \$100,000 of the \$426,000 Home Purchase Price
\$845.24 (\$226,000 x 0.00374) is added for the remaining \$226,000 of the \$426,000 Home Purchase Price
(The Home Purchase Price did not exceed \$500,000 and so the last portion is a prorated amount between the \$200,000-\$500,000 range)
Now, we add these numbers together: \$220 + \$172.72 + \$257.15 + \$467.50 + 845.24 = \$1,962.61
Finally, we take that number and multiply by 1.7818: \$1,962.61 x 1.7818 = \$3,496.98
\$3,496.98 is the Lenders/Owners Policy Fee.
It's not too difficult to solve this manually but in order to solve for my over all formula I need it to be a function.
Thank you again if anyone can help.

MENU