• Number: A positive or negative number, either integer or decimal.
  • Currency: A number that comes with a currency sign.
  • Percent: A number that comes with a percent sign, stored as a number divided by 100.

With numbers you can use many operators and functions

  • Such as +, -, *, /
  • Also =, >, <, >=, >=, !=
  • The function ROUND rounds a number to a given amount
ROUND(Price__c - Price__c * Discount__c, 2)

This ^ rounds it to 2 decimal places.

IF(Principal__c < 10000, 0.02,         
    IF(Principal__c >= 10000 && Principal__c < 100000, 0.03, 0.04))

Here we have an IF statement which applies an interest rate of 2% if principal is under $10,000. If it’s between $10,000 and $100,000 it’s 3%. For anything else (i.e. over $100,000) then it’s 4%.

The function EXP is used for calculating the interest based on a given principal, rate and number of years. It incorporates the mathematical constant e (2.7182…).

Here is the formula for this calculation: A = Pe^(rt)

Principal__c * EXP(Interest_Rate__c * (YEAR(TODAY()) - VALUE(YearStarted)))

Here ^ is the equivalent formula in Salesforce. The dates part of it calculates the period apparently. That is multiplied by the interest rate. That is multiplied by EXP. That is multiplied by the principal.

MIN function is used for making a calculation of which there must be a certain minimum. The following formula would calculate a commission if the minimum were $500.

MIN(500, Sale__c * Commission__c)

I created the following formula for calculating the volume of a cylinder based on the height and radius. It’s based on the equation: V = pi * h * (r^2)

3.14159 * Height__c * Radius__c * Radius__c

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s