Admin | Writing Payroll Formulas for Your Business's Needs

Formulas are where a company brings its own pay policy into the system. They are written like Excel, with one important difference: you use variable names instead of cell addresses, so formulas are readable and don't break when columns are added.

Formulas are where a company brings its own pay policy into the system. They are written like Excel, with one important difference: you use variable names instead of cell addresses, so formulas are readable and don't break when columns are added.

How to write them

A formula starts with the `=` sign, followed by keywords combined with arithmetic operators. An example included in the template:

ColumnFormula
Total allowances`= PHUCAP_TINH_THUE + PHUCAP_KHONG_THUE`

Always use keywords, not column letters. The letters A, B, C are only for locating columns during review; if you insert a column, the letters shift, but keywords don't change.

Variable library

The panel on the right of the Column Configuration screen lists every available variable, grouped by category, with a Find column search box. Variables already used in the template are shown in gray.

Variable groupContains
Basic informationID, name, position, department, bank account
Time itemsThe period's milestones and time ranges
Overtime & extra hours within shiftOvertime hours by type
ShiftsNumber of shifts, shift type
BranchWorkplace information
Leave, holidays & business tripsDays off by type
AdditionsAllowances and bonuses, split into subject to social insurance and not subject to social insurance
DeductionsSalary advances, fines, other deductions
Personal income taxTaxable income and tax payable
SalaryBase salary levels
RequestsData taken from approved requests
AssetsAsset-related deductions
KPI constantsCoefficients used for performance-based pay

Three principles for writing robust formulas

  1. Split into multiple intermediate columns instead of one long formula. One Total allowances column, one Total deductions column, then a Net pay column — much easier to review than a ten-line expression.
  2. Name columns by business meaning, not technical terms. The people who check the payroll are accountants, not programmers.
  3. Don't embed hard-coded numbers in formulas. Rates, coefficients, and thresholds should be set up as items in Salary Grades or as separate columns, so you only need to edit one place when they change.

The third principle matters most for legal figures. Writing a rate directly into the middle of a formula means that when regulations change, you'll have to hunt for it in every payroll template for every branch — and you will miss some.

Test before using for real

  1. Click View in the right corner to review the template.
  2. Create a test period with one small department.
  3. Select three to five employees in different situations: full attendance, on leave, with overtime, with a salary advance.
  4. Calculate each person by hand and compare with the system's results.
  5. Wherever there's a discrepancy, trace it back following article B9-18.

Formula errors shown on the payroll

SymptomCommon cause
Cell shows `#NAME?`The formula references a keyword that doesn't exist — usually a mistyped variable name or an item that was deleted
Cell is blank while other rows have figuresThat employee is missing source data, for example no salary amount entered
Result is 0A variable in the formula is 0, or the employee has no pay configuration

The `#NAME?` error cell appears directly on the employee's payslip if it isn't resolved before publishing. Always review all error cells before clicking Approve & lock.

지원
데모 예약
Chat