Workbench Formula Examples
Issue/Symptom/Question
Help with Workbench formulas
Applies To
Penta Workbench
Analysis Grid Formulas
Resolution/Fix/Answer
Formula Guide
Sample Percentage FormulasÂ
There are no null checks in these examples.  All examples assume that there is a number in the columns being used.
- Raw, unformatted calculated percentage
[Forecast at Complete Cost] /Â [Cost - JTD]
This formula calculates the value of the "Forecast at Complete Cost" column divided by the "Cost - JTD" column and displays it as a raw decimal value.
Values where the denominator are equal to 0 are displayed as "NaN" (not a number).
To make this formula work, replace the fields in orange with the column names specific to the report you are working with.
- Calculated percentage with basic formatting]
FormatPercent([Forecast at Complete Cost] /Â [Cost - JTD])
This formula calculates the value of the "Forecast at Complete Cost" column divided by the "Cost - JTD" column and displays it as a percentage.
Values where the denominator are equal to 0 are displayed as "NaN" (not a number).
Values where the numerator are equal to 0 are displayed as "Infinity".
To make this formula work, replace the fields in orange with the column names specific to the report you are working with.
- Calculated percentage with basic formatting and decimal places specified
FormatPercent([Forecast at Complete Cost] / [Cost - JTD], 3)
This formula calculates the value of the "Forecast at Complete Cost" column divided by the "Cost - JTD" column and displays it as a percentage with 3 decimal places displayed.
Values where the numerator are equal to 0 are displayed as "Infinity".
Values where the denominator are equal to 0 are displayed as "NaN" (not a number).
To make this formula work, replace the fields in orange with the column names specific to the report you are working with. Â Replace the number in pink with the number of decimal places that you want displayed.
- Calculated percentage with formatting and removal of NaN and Infinity values
iif([Cost - JTD] = 0, (FormatPercent(0, 3)), (FormatPercent([Forecast at Complete Cost] / [Cost - JTD], 3)))
This formula calculates the value of the "Forecast at Complete Cost" column divided by the "Cost - JTD" column and displays it as a percentage with 3 decimal places displayed. Â If the "Cost - JTD" column is equal to 0, it shows 0.000% instead of NaN.
To make this formula work, replace the fields in orange with the column names specific to the report you are working with. Â Replace the numbers in pink with the number of decimal places that you want displayed.
Sample Text Manipulation Formulas
- Position of a character within a string
InStr([Project Manager Name], ",")
This formula displays the position of the first comma it can find in the Project Manager Name column.
If the character is not found, it will display a 0.
To make this formula work, replace the field in orange with the column name specific to the report you are working with. Â Replace the character in pink with the character(s) you are looking for.
- Length of a string
Len([Project Manager Name])
This formula displays the length of string that is displayed in the Project Manager Name field.
To make this formula work, replace the field in orange with the column name specific to the report you are working with.
- Display the last x number of characters from a given string
Right([Project Manager Name], 4)
This formula displays the last 4 characters from the Project Manager Name column.
To make this formula work, replace the field in orange with the column name specific to the report you are working with. Â Replace the number in pink with the number of characters you want displayed. Â "Right" can be replaced with "Left" if you want to display characters from the front of the field instead of the characters from the end of the field.
- Display the length of a portion of a string
Len([Project Manager Name]) - InStr([Project Manager Name], ",") - 1
This formula calculates the length of the first name portion of the "Project Manager Name" column which is formatted as {last name}, {first name} {middle init}.
The "-1" portion is needed in this particular formula because there is a space between the comma and the first name. Â If you don't have a space, just remove the "-1" part of the formula.
To make this formula work, replace the field in orange with the column name specific to the report you are working with. Â Replace the character in pink with whatever the separator character is that you are looking for.
- Display a portion of a string
Right([Project Manager Name], (Len([Project Manager Name]) - InStr([Project Manager Name], ",") - 1))
This formula display the first name portion of the "Project Manager Name" column which is formatted as {last name}, {first name} {middle init}.
The "-1" portion is needed in this particular formula because there is a space between the comma and the first name.  If you don't have a space, just remove the "-1" part of the formula.
To make this formula work, replace the field in orange with the column name specific to the report you are working with. Â Replace the character in pink with whatever the separator character is that you are looking for.
- Display numeric as text in order to create formula
- CStr([Costcode])Â
- This formula will display the "Costcode" as a text
- Combine 2 columns into 1 column
- Column+ ","+Column