Formula Custom Fields: Possible Formulas and Resulting Data Types
Formula custom fields allow you to add calculations to the data that you enter in your custom and system fields. You can add different types of fields to one formula, but the calculated result can only be one type.
Let’s say we need to calculate the total payment for an employee who charges per hour:
Formula example: [Hourly Rate]*[Time Spent]=Currency
The field [Hourly Rate] has the Currency data type, and the field [Time Spent] is set as Hours. The resulting field type of calculation will be Currency.
The table below shows which types of fields can be included in formulas together, which math operation can be applied to them, and what the resulting data type will be.
-
Choose the data type of the first field in the formula from the first column on the left.
-
Underneath it, choose the row with the required math operation.
-
Follow the row to the column with the data type of the second part of the formula.
Note
The order of fields in the formula determines the resulting type of data. For example, if you divide Number by Hours, the resulting type will be Number. But if you switch the fields in the formula and divide Hours by Number, the result will be Hours.
Number |
Currency |
Percent |
Days |
Hours |
|
---|---|---|---|---|---|
Number |
|||||
+, - |
Number |
Currency |
Number |
Days |
Hours |
* |
Number |
Currency |
Number |
Days |
Hours |
/ |
Number |
Number |
Number |
Number |
Number |
Currency |
|||||
+, - |
Currency |
Currency |
Currency |
Number |
Number |
* |
Currency |
Number |
Currency |
Currency |
Currency |
/ |
Currency |
Number |
Number |
Currency |
Currency |
Percent |
|||||
+, - |
Number |
Currency |
Percent |
Number |
Number |
* |
Number |
Currency |
Percent |
Days |
Hours |
/ |
Percent |
Number |
Number |
Number |
Number |
Days |
|||||
+, - |
Days |
Number |
Number |
Days |
Hours |
* |
Days |
Currency |
Days |
Number |
Hours |
/ |
Days |
Number |
Days |
Number |
- |
Hours |
|||||
+, - |
Hours |
Number |
Number |
Hours |
Hours |
* |
Hours |
Currency |
Hours |
Hours |
Number |
/ |
Hours |
Number |
Hours |
Number |
Number |
Important
You can select in which format you want to see the calculated result of all types of formulas except for the date type. For example, if your formula is [Due date]-[Start date] the result is always shown in days.
The system "Duration" field calculates only working days, while a custom-created duration field accounts for calendar days including non-working days such as weekends, holidays, etc.