Calculation fields are available in Membrain Excellence Tier and can be used on Sales Projects, Prospects, Companies & Contacts.

Calculation fields can also work with both Number, ScoreCard and Date properties from a Sales Project, Prospect, Company or Contact. To use these you have to use the Insert Property button in the editor. In this article we will prefix any such variable with @, example: @Value to make it clear that a variable is referenced.

Here are some examples on how to use this feature:**Calculate profit margin**((@Value - @OurCosts) / @Value) * 100

**Average the value of multiple scorecards**Average(@FirstScoreCard, @SecondScoreCard, @ThirdScoreCard)

**Calculate revenue this fiscal year**MonthsBetween(@ClosingDate, '2017-04-31') * @MonthlyValue

**Value Types**

Calculation fields works with two types of values: Numbers and Dates.

Dates can only be used as input to certain functions.

Numbers are given either as 123, or 1.23. Dates are given as '2016-12-31'.**Operators**

Calculation fields support the following operators: +, -, * and /.

**Functions****Min**Min takes any number of arguments, either a number, or a referenced numerical property and returns the smallest of those numbers. Example: Min(1,5,3) = 1

**Max**

Max takes any number of arguments, either a number, or a referenced numerical property and returns the largest of those numbers. Example: Max(1,5,3) = 5

**Sum**

Sum takes any number of arguments, either a number, or a referenced numerical property and returns the sum of those numbers. Example: Sum(1,5,3) = 9. Sum is thus exactly the same as 1+5+3.

**Average**

Average takes any number of arguments, either a number, or a referenced numerical property and returns the average of those numbers. Example: Sum(1,5,3) = 3.

**Round**

Rounds a number either up or down depending on its value. Example: Round(0.3) = 0. Round(0.6) = 1

**Floor**

Rounds a number down. Example: Floor(0.9) = 0. Floor(0.1) = 0

**Ceil**

Rounds a number up: Example: Ceil(0.1) =1. Ceil(0.8) = 1

**DaysBetween**

Takes two dates and returns the number of days between those dates. Example DaysBetween('2016-01-01', '2016-02-01') = 31

**MonthsBetween**

Takes two dates and returns the number of months between those dates. Example MonthsBetween('2016-01-20', '2016-04-12') = 3

**Years Between**

Takes two dates and returns the number of months between those dates. Example Years Between('2016-01-20', '2018-02-12') = 2