Harmony P - Creating Payroll Categories with a Formula

Harmony P - Creating Payroll Categories with a Formula

All payroll categories can be created with a formula to automate simple calculations for you. By default, without a formula, a payroll category will be calculated based on the values that are manually entered into the payroll category setup (under Payroll > Payroll Setup > Payroll Categories > In the 'Amount' or 'Rate' field), in the employee's master paycard (under Payroll > Payroll Employees > Assign Payroll Category), or in the paycard itself during the payroll process (under Processing > Payroll Wizard > Step 3: Process Payroll step). However, you can define a formula for a payroll category to automatically calculate based on other payroll categories. Take a look at the Vacation Accruals article for examples - this outlines a formula based on a percentage of gross earnings.

Other than automating a calculation, you can also define a formula of which it will refer to the hourly rate for an employee. This means that if you have an hourly employee who received a raise, you only need to change the hourly rate for t he employee once for one payroll category, rather than changing the rate for all payroll categories for one employee. Refer to the example scenarios at the end of this article for more information.

Building a Formula

  1. Navigate to Payroll > Payroll Setup > Payroll Categories. 

  2. Create a new payroll category as normal, or select an existing payroll category to create a formula for it. 

  3. Depending on the "Basis" field that you select, the formula you define will be in accordance to it. For example, if 'Salary', then you may only define a formula for the Amount. You may also define a percentage. If 'Units', then you may only define a formula for the units or the rate of the payroll category. If 'Script', you cannot define a formula for this payroll category. 

  4. Navigate to the formula tab on the right-side of the payroll category setup window, called '(fx) Formula'. This is where you will build your formula. Take a look at the images and definitions below to identify the different sections of this page. 

  5. Once you've defined your formula, click the "Validate" button in section 5 to verify that the formula is valid. 

  6. Once successfully validated, click the save button to save your changes to the payroll category.

Take a look at the image below to identify the different sections of the formula page: 

Section 1 (red)

This is where you will identify if this payroll category will use a formula to calculate. If the "Basis" is set to 'Salary', you can only define a formula for 'Amount'. If the "Basis" is set to be 'Units', you can define a formula for the 'Units' or 'Rate'. Ensure that you're selecting the correct one. If 'Script', you cannot define a formula for this payroll category. 

Section 2 (orange)

This is where you can define the processing order of this payroll category. By default, payroll categories that have a formula will automatically process towards the end, but you may want to update this field if you would like this particular payroll category to process before or after other payroll categories that also have a formula defined. Refer to this article about processing order for more information. 

Section 3 (green)

This is where you can select particular payroll categories to include or exclude from the formula. Use the checkboxes to select these payroll categories. Tip: You cannot mass-select all payroll categories at once. If you are adding payroll categories to the formula, you will want to separate the payroll categories with a "+" from section 5. 

Section 4 (blue)

The formula area is where your formula will be displayed. This is the final formula of which will be used for the calculation. You cannot modify this field manually - you must use the options in section 3 and 5 to define your formula. 

Section 5 (purple)

Use this calculator and the orange bars above the calculator to define your formula, together with the payroll categories in section 3 (if applicable). 

  • "Employee Rate" refer to the rate that is set up in the employee's profile for payroll information. 

  • "Assigned Units" refer to the assigned units in this payroll category in the employee's master paycard. This option can only be included in payroll categories in which the "Basis" is 'Units'

  • "Assigned Rate" refer to the assigned rate/amount in this payroll category in the employee's master paycard, depending on the "Basis" of the payroll category.

Example Scenarios

Below, you will find some sample scenarios of which you may want to define a formula for a payroll category. 

Percentage of Gross Earnings

If you're looking to calculate a payroll category as a percentage of gross earnings, or a select group of payroll categories, you will need to define a formula. 

  1. Ensure that the "Basis" of the payroll category is set to 'Salary'

  2. In section 5, select the open parentheses ("("). 

  3. In section 3, select the first payroll category that contributes to gross earnings. 

  4. In section 5, select the plus button ("+"). 

  5. Repeat steps 2-3 for every payroll category that contributes to gross earnings. 

  6. In section 5, select the close parentheses (")"). 

  7. In section 5, select the multiply button ("x"). 

  8. If the percentage is the same for all employees, enter the percentage value with the calculator. For example, for 4%, you can enter either "0.04" or "4/100". If the percentage is different for each employee, select the "Assigned Rate" from above the calculator. 
    Note: Depending on how you enter the value in the employee's master paycard, you may want to add "/100" from section 5 into the formula. For example, if you define "4" for 4% in the employee's master paycard, you will want to add "/100" into the formula. But if you are defining "0.04" in the employee's master paycard, you do not need to add "/100" into the formula. 

Referring to the Hourly Rate for an Employee 

When an hourly employee receives a raise, you can manually change every payroll category's rate in the employee's master paycard to reflect the new rate. Alternatively, you can define a formula so you only need to change the rate once in the employee's master paycard. Note: This formula can only be used if the payroll category is unit-based. 

  1. Ensure that the "Basis" of the payroll category is set to 'Units'

  2. In section 1, select 'Rate'

  3. In section 3, select the hourly rate payroll category, such as 102. 

  4. Validate and save as normal. 

This means that when an employee receives a raise, you only need to change the hourly rate in the employee's master paycard once - in 102 (as per example above). It will automatically change all other payroll categories with this formula when you are processing payroll. 

Note: Because the rate will be calculated by a formula, the rate for this payroll category in the employee's master paycard will be zero. 

Overtime Rates

When an hourly employee works overtime, it is typically a special rate based on their regular hourly rate. You can define a formula to define the premium rate! Note: This formula can only be used if the payroll category is unit-based. 

  1. Ensure that the "Basis" of the payroll category is set to 'Units'

  2. In section 1, select 'Rate'

  3. In section 3, select the hourly rate payroll category, such as 102. 

  4. In section 5, select the multiply button ("x"). 

  5. In section 5, define the rate dependent on the hourly rate. For example, if overtime is 1.5x the hourly rate, enter "1.5". If overtime is double time, or 2x the hourly rate, enter "2". 

  6. Validate and save as normal. 

This means that when an employee works overtime, it will automatically calculate the employee's premium rate with this formula when you are processing payroll. This also applies if you change the employee's rate in the middle of a pay process. 

Note: Because the rate will be calculated by a formula, the rate for this payroll category in the employee's master paycard will be zero. 

'Matching' Payroll Category

When you have an employee deduction, you may have an employer matching portion, such as for RRSPs or 401Ks. You should be defining the formula for the employer matching portion (benefit payroll category). 

  1. Ensure that the "Basis" of the payroll category is set to 'Salary'

  2. In section 3, select the employee deduction category of which you want to match. 

  3. Validate and save as normal. 

Note: Because the value will be calculated by a formula, the amount for this payroll category in the employee's master paycard will be zero.