Columns, variables and formulas
Set up payroll columns, use variables from HRIS, Timesheet and other sources, and write Excel-style formulas that calculate cleanly.
Columns are the lines on your payroll and payslips: base salary, allowances, overtime, deductions, take-home pay. This article explains the three kinds of column, where formulas get their numbers from, and how to write formulas that calculate cleanly every month.
Before you start
You'll edit columns on a policy's Columns tab, so you need to be an owner of the policy or a payroll admin.
Connect your data sources first, so the variables you want to use are available.
Three kinds of column
| Type | Use it for | Example |
|---|---|---|
| Input | A value that's typed in, read from a data source, or copied from another payroll. | A one-off bonus, working days from Timesheet, the advance from last month's run. |
| Constant | The same fixed value for everyone. | A meal allowance of 730,000. |
| Formula | A calculation, written like an Excel formula starting with =. | =base_salary * work_day / period_days |
Every column also has a Tag (Earning, Tax & compliance or Other) that controls how it's grouped, and a data type: number, currency, text or date. Choose currency for money so it prints with the right symbol and decimals. You can also decide whether a column is visible on the payslip.
Where the numbers come from: variables
A formula can use three kinds of names:
Other columns, by their Code. A column can only use columns placed above it.
System variables that Payroll always provides, such as the period's days.
Source variables from connected sources. Each one has a code you type straight into a formula.
To see every variable a source offers, open the Sources page. Each built-in adapter (1) lists its variable codes (2) with a label, data type and description (3). Greyed-out variables are marked no data source yet, meaning nothing feeds them in your workspace for now.

Add a column
Open the policy's settings and go to the Columns tab. You'll see each column's number, name, code, source, tag and formula or value.
[IMAGE: people-ops/payroll/images/payroll-columns-formulas-02.png | The Columns tab of a policy with the column list, the search box, AI Build, Insert from template, Add Column and the locked tax rows marked]
Click Add Column. To start from a ready-made set instead, use Insert from template.
Fill in Name, Code and an optional Description. The code is what other formulas use, so keep it short and stable.
Pick the Position, the Tag and the Type, then complete the fields for that type.
[IMAGE: people-ops/payroll/images/payroll-columns-formulas-03.png | The add column dialog for a Formula column, with Name, Code, Position, Tag, Type, the formula box and the Advanced rounding, format and conditions section marked]
Save. The formula is checked as you save, and a column with a broken formula won't save.
Prefer to describe the column in words? AI Build drafts it for you when an AI connection is set up.
Write formulas
Formulas work like Excel. You can use + - * / %, comparisons such as =, <> and >=, and AND, OR, NOT. Handy functions include:
Logic:
IF,IFERROR,ISBLANK,BSWITCHMaths:
ROUND,ABS,INT,FLOOR,CEIL,MOD,SUM,AVG,MIN,MAX,COUNTDates:
DATE,YEAR,MONTH,DAY,TODAY,DATEDIF,EDATE,EOMONTHBrackets:
PROGRESSIVEandPROGRESSIVE_TABLEfor tiered rates such as tax
Example: pay a 500,000 attendance bonus only when nobody was late:
=IF(sum_late = 0, 500000, 0)
Not sure where to start? Presets can write common patterns for you: a fixed percentage, a fixed amount, proration by days, progressive brackets, an overtime multiplier, a minimum and maximum cap, a percentage of another column, and a remainder.
Scope, conditions and rounding
Scope: most formulas are per employee. A payroll-scope formula is calculated once for the whole payroll, such as a bonus pool. A payroll-wide formula can't read a per-employee column directly; use a total instead.
Conditions (under Advanced): when the condition is false, the column is set to 0 (or empty for text).
Rounding, decimals and number format (also under Advanced) change how the value is displayed.
Good to know
Proration is automatic. A formula that uses day-based variables is split across career changes in the period, so a mid-month raise is paid correctly without extra columns.
Circular formulas are blocked. A column can't use its own code, and two columns can't depend on each other. You'll get a clear message naming the columns.
Missing source data reads as 0, not as an error.
Red
#ERR!cells mean the formula itself failed, often because values in two different currencies were combined. Payslips and exports show these cells as blank.Hand edits stick. If you type over a calculated cell on a payroll, recalculating keeps your value and updates the columns that depend on it.
On a single payroll you can edit its columns and choose Save (this payroll only) or Save to template (the policy, for future payrolls). ✨