Calculated Property to work out value of LTV (Loan to Value)

Hi All, I am trying to calculate LOAN TO VALUE (LTV) in HubSpot.

I created a formula using a calculated property. (See screenshots)

The lower the LTV the better (The best scores 5, and the worst -1)

I have tested these x2 formulae to work out a percentage, but both are not returning the correct % (LTV)

(Deposit amount / Loan amount) * 100

(Loan amount / Deposit amount) * 100

The loan amount is the asset.

Then I created a score property conditions to match a range of values with to and from conditions.

I have some Score criteria conditionals with a max and min value (e.g. if > 80 then score -1).

if <80 but >= 70, then score 2

if <70 but >= 60, then score 3

if <60 but >= 50, then score 4

if <50, then score 5

Only one should be true, but it should change based on the condition.

However, it does not appear to be working. I switched the order of loan amount and deposit, but the values are still incorrect.

A correct LTV calculation in the below examples should be

Loan 100,000 / deposit 50,000 = LTV 50%

Loan 100,000 / deposit 20,000 = LTV 80%

The higher the deposit %, the better the HubSpot score (In this case the lower the LTV, the better/higher the HubSpot score.

I subtracted the loan amount by deposit and then x100 to get a percentage value. Then I switched the order of (deposit/loan), but both options are returning the wrong value.

Any suggestion?

Hey, @HubSpotScaler :waving_hand: Happy to take a look. I took a sec and recreated your example + ran your formula through a calculator (cause maths give me anxiety :rofl:)

To my eye, this is a case of your formula works according to the rules of PEMDAS, but not in the way you are expecting it to.

Example 1 — ((LoanAmount / DepositAmount ) * (100 * 1) works as expected:

  • (100000/50000) * (100*1)) = 200 becasue 100000/50000 = 2 * (100*1) = 200
  • (100000/20000)*(100*1) = 500 becasue 100000/20000 = 5 *(100*1) = 500

If we flip it,

Example 2— ((DepositAmount / LoanAmount ) * (100 * 1) works as expected:

  • (50000/100000)*(100*1) = 50
  • (20000/100000)*(100*1) = 20

To my eye, Example 2 is closer to what you are after. But the calculation doesn’t quite work like you want it to. If we remove the (100 * 1) part, it already produces a result as a decimal — .5 and .2, but you are after the opposite side of the result. Meaning for (20000/100000) you want the .8 and not the .2, but it won’t work that way.

You’ll either need to adjust your lead score to reflect that a smaller result is higher in value, or do some more exploring to find a different type of formula.

My other thought is splitting it up into two calculation properties, one to calculate the difference and one to produce the result in the format you are after. Here’s my quick test:

I created two properties:

LTV-number to handle the subtraction

LTV-calc to handle the division and conversion

The result

The last part that is a bit confusing is your initial request indicates you want the result to be a percentage(a decimal in this case) but your lead score uses whole numbers. Can you clarify the result you are after, please?

Hey, @Jnix284 @louischausse @karstenkoehler @piersg @danmoyle, how do you feel about a little maths on a Friday?

Thank you! — Jaycee

@Jaycee_Lewis maths on a Friday… I dunno about that. :joy:

That looks like a great solution though! :raising_hands:

Hi Jaycee,

Thanks, I tried splitting it up into two calculation properties.
I used the 2 examples you created.

The result was also not as expected.
However, I added another line of *100 and it produces a workable solution.
It shows a deposit percentage of the loan.
So if the deposit is 20%, it is 1/5th of the value (e.g. £20/£100)

If the deposit is the same as the loan amount, it is 100%.

I can now create some scorecards based on the %.

Best Regards
Liam