All articles

Formula Custom Fields: Possible Formulas and Resulting Data Types

Last updated on

Wrike Documentation Team

Wrike Documentation Team

TL;DR

Formula custom fields can combine supported field types, but each formula returns only one result type, such as NumberCurrencyPercentDays, or Hours. The result depends on the field types, math operation, and even the order of fields in the formula. Most results can be reformatted, except date-based results like [Due date] - [Start date], which always show in days.

Table 35. Availability - Legacy plans

Availability: Legacy Business, Legacy Enterprise.; Unavailability: Legacy Free, Legacy Professional.;

Table 36. Availability

Availability: Team, Business, Pinnacle, Apex. ; Unavailability: Free;

Overview

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.

Possible Formulas and Resulting Data Types

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.

  1. Choose the data type of the first field in the formula from the first column on the left.
  2. Underneath it, choose the row with the required math operation.
  3. Follow the row to the column with the data type of the second part of the formula.

    formula.gif

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.

FAQ

Can the custom fields order be changed in the 'More fields' section?

Fields inherited from parent locations are sorted alphanumerically in the More field section. If you wish to put fields into a particular order, you can create a custom item type and adjust its settings.

I have a formula custom field to track duration based on the formula [Due date] - [Start date]. Why are the values in my CF different from the system Duration field?

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.

I use a Formula Custom Field to tracks duration using the formula: ([Due Date] + 1). Why does this extend the value by 1 hour instead of 1 day?

When you add a number to a formula that includes only date fields, Wrike interprets the number as hours, not days. Remember that 1 working day in Wrike = 8 hours. To add 1 day, use this formula instead: ([Due date] + 8). To add several days, multiply the number of days by 8 and add this value to your formula.

Top