Standard Functions & Operators (Cash Formulas)

<< Click to Display Table of Contents >>

Navigation:  Editing Case Data > Fiscal Models > Cash Formulas >

Standard Functions & Operators (Cash Formulas)

Navigation: Editing Case Data > Fiscal Models > Cash Formulas >

hm_btn_navigate_prevhm_btn_navigate_tophm_btn_navigate_next

Show/Hide Hidden Text

The following is a list of all of the standard functions available in cash formulas. There are also several custom PHDwin functions and tokens and modifiers that can be used in combination with these to write the cash formulas.  

hmtoggle_plus1 Logical Functions

 

Function(and syntax)

Description

And(Condition1, Condition2, Condition3, ...)

Returns true if all arguments are true, otherwise false.

If(LogicalTest, ValueIfTrue, ValueIfFalse)

Conditional statement that returns one answer if a logical test is true and a different answer if the test is false.

Not(Condition)

If the condition is true, Not returns false.  If the condition is false, Not returns true.

Or(Condition1, Condition2, Condition3, ...)

Evaluates to true if any one or more of the Conditions evaluates to true. If all conditions are false, returns false. Note, each 'Condition' must contain a comparison.

 

hmtoggle_plus1 Mathematical Functions

 

Function(and syntax)

Description

Abs(Value)

Returns the absolute value of the "Value" entered. The value can be a number, a calculation or another formula name.

Exp(x)

Returns the value of e^(x).  e≈ 2.71828

InRange(Value, Low, High)

Returns true if 'Value' lies between 'Low' and 'High', otherwise returns false.

Int(Value)

Returns the "value" rounded down to the nearest integer - decimal is truncated.

Ln(Value)

Returns the Natural Logarithm (base e) of 'Value'

Log(Value)

Returns the Logarithm of 'Value' to base 10

Max(Value1, Value2, Value3, ...)

Returns the largest value from a list of Values.

Min(Value1, Value2, Value3, ...)

Returns the smallest value from a list of Values.

Round(Value)

Returns the 'Value' rounded to the nearest integer.

Sqrt(Value)

Returns the square root of 'Value.'

 

hmtoggle_plus1 Date Functions

The functions listed here are the date functions that require parameters to be passed on to them. There are other date related functions like CurrentDate which do not require any parameters or modifiers after them. These date functions are grouped with other functions that do not require parameters or modifiers and are explained in the last section under functions that require no parameters.

Function(and syntax)

Description

AddMonthsToDate(Date, Months)

Returns the date that results after adding a specified number of 'Months' to the 'Date' given.

Date(Month, Year)

Returns the first day of the month if you input month and year.

Month(Date)

Returns the month of 'Date.' Date format must be a date token or mm/dd/yyyy

MonthsBetweenDates(Earlier_Date, Later_Date)

Returns the number of months between 'Earlier_Date' and 'Later_Date.' If the later date is first, this will return a negative number. Assumes the first day of month on each date. To get to end of the last month, add a 1 to the result of the function.

Year(Date)

Returns the year of 'Date.'

 

 

Date Integers

If a formula tries to return a date value, that value will be converted to an integer as follows:

               Year x 100 + month

For example, a formula consisting of only the token CurrentDate would return the following integers for these dates:

Jan 1, 2014 =  201401

Jan 2, 2014 =  201402

Jan 3, 2014 =  201403

 

Note: to turn off AnnualSum in the formula settings or the numbers will get added together. In addition, dividing by 100 and taking the integer value will yield the year, while doing a modulus 100 (% operator—e.g. % 100) will yield the month.

hmtoggle_plus1 Operators

The following operators are supported in cash formulas:

*   Multiplication operator (the x is not supported for a multiplication symbol)

/   Division operator

%   Modulus operator (returns the remainder)

=     Equals

-  Subtraction operator

+    Addition operator

<    Less than operator

>  Greater than operator

<=  Less than or equal to operator

>=  Greater than or equal to operator

^    Exponent operator - returns value of x raised to y power (x^y)

<>  Not equal to operator

Related topics:

Cash Formulas

Custom PHDwin Functions

Other cash formula tokens/functions

Static Variables