Skip to main content
Pay structure

Formulas for components and bands

Calculate a component's value or a pay band value with a formula, and set fallbacks.

Written By Karl

Last updated 5 days ago

Formulas let Evenpay calculate a value instead of you typing it in, for example an allowance based on working hours or a band minimum based on another figure.

Who can do this: Administrators.

Where formulas are used

  • Salary components: in the component editor, choose Calculated from a formula.

  • Pay bands: each band value (Min, Mid, Max) can be Static or Formula. See Creating pay band rules.

Write a formula

  1. Open the Formula Configuration editor.

  2. Use the Variable picker to insert values such as other components or employee fields.

  3. Use the Functions picker to add calculations.

  4. Use Test with sample values to check the result before you save.

  5. Set Fallback values for when the formula can't be calculated, for example because a value is missing. A fallback can be a Fixed value or a Range.

  6. Save.

How formulas are written

  • Put variables in curly braces, for example {base_salary}. The Variable picker inserts them with the right key for each component and field.

  • Calculate with +, -, *, /, % (remainder) and ^ (power), and use brackets to set the order.

  • Compare with ==, !=, <, <=, > and >=. Combine conditions with and, or and not, or with && and ||.

  • Write text in double quotes, such as "Night", and decimals with a point: 0.1, not 0,1.

  • A component formula must produce a number.

Variables you can use

Variable

Value

{component_key}, such as {base_salary}

The employee's monthly amount of that component or benefit. A calculated component can use other calculated components, as long as they don't depend on each other in a loop.

{employee:workingHours}

Contracted weekly working hours.

{employee:fte}

Full-time equivalent, for example 0.8 for 80%.

{employee:hourlyRate}

Hourly rate worked out from {base_salary} and the employee's working hours.

{employee:tenureYears}

Years since the employee's start date, to one decimal.

{employee:orgHoursPerWeek}, {employee:orgHoursPerMonth}

Your organisation's standard working hours.

{position:salaryBandMin}, {position:salaryBandMid}, {position:salaryBandMax}

The employee's pay band, as monthly amounts.

{job_level:tier}, {job_grade:tier}

The numeric tier of the employee's job level or grade.

{job_level:salaryBandMin}, {job_level:salaryBandMax}, {job_grade:salaryBandMin}, {job_grade:salaryBandMax}

The band values stored on the job level or grade.

{cf:employee:Field name}

A custom field on the employee. Replace employee with position, job_level, job_grade, job_family or org_unit to read a field from the employee's position, or from that position's job level, grade, job family or organisation unit.

How custom field values are read

  • Number fields give their number. A Percentage field gives a decimal: 10% is read as 0.1.

  • Yes/No fields give 1 for yes and 0 for no.

  • Option fields give the option's Value if it has one. Otherwise they give the option's name as text, which you can compare, for example {cf:org_unit:Shift pattern} == "Night".

  • Text fields can't be used in component formulas.

  • Write the field name exactly as it is spelled, including spaces and capitals. A field whose name contains a colon (:) can't be used.

  • To vary pay by organisation unit or job family, use a custom field on the organisation unit or job family. The {position:orgUnit}, {position:jobFamily} and {job_level:code} variables are internal codes, not names, so they can't be compared with text.

Functions

Function

What it does

MIN(a, b, ...), MAX(a, b, ...)

The smallest or largest value. Empty values are skipped.

ROUND(value, decimals)

Rounds to the given number of decimals, or to a whole number if you leave decimals out.

FLOOR(value), CEIL(value)

Rounds down or up to a whole number.

ABS(value)

The value without its minus sign.

PERCENT(value, pct)

value Γ— pct Γ· 100.

CLAMP(value, min, max)

Keeps the value between min and max. An empty min or max means no limit on that side.

IF(condition, then, else)

One value when the condition is true, another when it isn't.

IFS(condition1, value1, condition2, value2, ..., default)

The value of the first true condition. The last value on its own is the default.

AND(a, b, ...), OR(a, b, ...), NOT(a)

Combine conditions.

ISBLANK(value)

True when the value is missing.

COALESCE(a, b, ...)

The first value that isn't empty.

Amounts, frequencies and missing values

  • Component variables and pay band values are monthly amounts.

  • Write the result in the component's Payment Frequency. For an Annual component, the formula gives the yearly amount, such as {base_salary} * 12 * 0.1, and Evenpay converts it to monthly.

  • Results are rounded to two decimals.

  • When a value the formula needs is missing, for example the employee doesn't have that component or a custom field is empty, the calculation can't finish and the fallback is used. Use ISBLANK, COALESCE, MIN, MAX or CLAMP to handle missing values yourself.

  • With a Range fallback, Evenpay uses the middle of the range.

Example formulas

Replace the component keys and custom field names with your own. The Variable picker shows the exact keys.

What it calculates

Formula

10% of base salary

PERCENT({base_salary}, 10)

A 300 monthly allowance, pro-rated for part-time employees

ROUND(300 * {employee:fte}, 2)

Overtime at 1.5 times the hourly rate, with the hours in a number field on the employee

ROUND({employee:hourlyRate} * 1.5 * {cf:employee:Overtime hours}, 2)

An allowance that grows with tenure

IFS({employee:tenureYears} >= 10, 200, {employee:tenureYears} >= 5, 120, {employee:tenureYears} >= 2, 60, 0)

An allowance by job grade

IFS({job_grade:tier} >= 7, 800, {job_grade:tier} >= 5, 500, 250)

An annual bonus target from a Percentage field on the job level, in a component whose Payment Frequency is Annual

{base_salary} * 12 * {cf:job_level:Bonus target %}

A bonus scaled by a number field on the job level

ROUND({base_salary} * 0.05 * {cf:job_level:Bonus multiplier}, 2)

A shift allowance from an option field on the organisation unit

IF({cf:org_unit:Shift pattern} == "Night", 250, 0)

On-call pay from a Yes/No field on the position

IF({cf:position:On-call} == 1, 400, 0)

A location allowance from an option field whose options have a Value, or 0 when it isn't set

COALESCE({cf:employee:Location allowance}, 0)

An allowance that needs two conditions

IF(AND({job_grade:tier} >= 5, {cf:org_unit:Region} == "Nordics"), 500, 0)

A top-up that brings pay up to the band minimum

MAX({position:salaryBandMin} - {base_salary}, 0)

A 10% bonus that never takes pay above the band maximum

MIN({base_salary} * 0.1, {position:salaryBandMax} - {base_salary})

10% of base salary, but at least 200 and at most 350

CLAMP({base_salary} * 0.1, 200, 350)

Commission from an optional rate field, or 0 when the field is empty

IF(ISBLANK({cf:employee:Commission rate}), 0, {base_salary} * {cf:employee:Commission rate})

An amount from an override field, or 350 by default

COALESCE({cf:employee:Car allowance override}, 350)

Holiday pay from base salary and another component, including a calculated one

ROUND(({base_salary} + {shift_allowance}) * 0.5, 0)

An amount rounded to the nearest 10

ROUND({base_salary} * 0.043 / 10) * 10

Pay band formulas

Band formulas are simpler. They can use the tier and band values of the job grade and job level the rule matches on: {job_grade:tier}, {job_grade:salaryBandMin}, {job_grade:salaryBandMid} and {job_grade:salaryBandMax}, and the same with job_level. The functions are MIN, MAX, ROUND, FLOOR, CEIL, ABS, IF and PERCENT.

  • The rule needs a Job Grade or Job Level dimension. If it names several, the first one is used.

  • If a value the formula uses isn't set, the band value stays empty.

  • Examples: {job_grade:salaryBandMin} * 1.1, ROUND({job_grade:salaryBandMid} * 0.9, 0) and IF({job_grade:tier} >= 5, {job_grade:salaryBandMax} * 1.05, {job_grade:salaryBandMax}).

Getting help from an AI assistant

To have an AI assistant draft a formula, give it this article, what the component should pay, its Payment Frequency, and the component keys and custom field names from the Variable picker. Don't share employees' pay data. Paste the result into the editor and check it with Test with sample values before you save.

A simpler option for percentages

If a component is just a share of another one, use the Percent of another component value shape instead of a formula. See Value shapes: ranges, units, in-kind benefits and equity.

Good to know

  • Changes made by formulas appear in employee history with the source Formula.

  • Always set a fallback, so employees with missing data still get a sensible value.