How_do_I_use_operators_and_variables_in_a_formula_

How do I use operators and variables in a formula?

Set up and save the formulas that you will use to calculate federal and state withholding. You can set up a formula to use information collected from a pay code to calculate an amount and tie it to a pay code.

 

If you have been notified by the Payroll group that the federal and state withholding are available for your state, you can download and install the Connect version to replace the master formula with the master formula for the new payroll year. The instructions are part of the Payroll Year-end Checklist, steps 7b and 7c.

 

Adding a calculation formula

1. Open Connect Payroll > Organization > Calculation Formulas.

2. Click New (CTRL+N).

3. Use the Formula Name box to enter the formula name.

4. Click .

You can type the formula directly into the Formula box. Clicking the Modify button will launch the Formula window with a list of the variables and operators.

5. Use the Calculations box to enter the formula.

Start by defining the variables that you will use in the formula. It's easier to review if you start a new line for each variable. After the variables are defined, enter "RESULT=" to enter the equation.

  • To insert a variable, place the cursor at the insertion point in the equation and then double-click the variable name.

  • To insert an operator, place the cursor at the insertion point in the equation and then double-click the operator name. You can also use the keyboard to enter an operator.

 

Calculation box

 

For example, entering a federal withholding calculation might look like this...

VAR1 = MAX(0, WagesCurrPer - ((CurrentExceptions + CurrentAdditionalExceptions) * Modifer1))

RESULT = Table(Var1)

 

Calculation box

 

6. When you're done, click .

The syntax refers to the equation that is entered as the formula. Checking the syntax will look for operators and symbols that are missing from the equation.

If there's a syntax error, follow the instructions on the screen to correct it. The calculation must be error free before you can save it.

No Errors Found dialog box

 

7. Click Save (CTRL+S).

The calculation formula is saved. The next step is to tie the calculation formula to a calculation (Organization > Calculations) and link the calculation to a pay code (Organization > Pay Codes).

 

Formula variables

When you set up a calculation, you can use these variables. The variables are located in the variables list. The variables allow you to create calculations that will calculate using information collected from a pay code or employee pay code.  

Additional Exemptions

AdditionalExemptions(###-##)

Returns the number of additional exemptions from the specified employee pay code. Replace ###-## with the pay code and sub code on the pay code with the exemption setting.

 

Additional Withholding

AdditionalWithholding

Returns the additional withholding amount from the current employee pay code by pay period.

 

Annual Wage

AnnualWage

Returns the employee annual wage.

 

Current Additional Exemptions

CurrentAdditionalExemptions

Returns the number of additional exemptions from the current employee pay code.

 

Current Exemptions

CurrentExemptions

Returns the number of exemptions from the current employee pay code.

 

Current Pay Period Number

CurrentPayPeriodNumber

Returns the number associated with the current pay period. Pay period range is 1 to 5.

 

Current Month Wages

CurrMoWages

Returns the total wages for the month which includes the check issue date.

 

Current Period Amount Pay Code

CurrPerAmtPayCode(###-##)

Returns the amount for the current pay period from the specified employee pay code. This value is divided by the pay period frequency. Replace the (###-##) with the pay code and sub code.

 

Deductions

Deductions

Returns the deduction amount from the current employee pay code.

 

Dependents

Dependents

Returns an amount based on the number of qualifying children from the current pay code.

 

Employee Age

EmployeeAge

Returns the employee age.

 

Employee Amount Rate Percent

EmployeeAmountRatePercent(###-##)

Returns the employee amount, rate, or percent from the employee pay code. Replace the (###-##) with the pay code and sub code.

 

Employee Birth Date

EmployeeBirthDate

Returns the employee date of birth.

 

Employee Calculated Amount

EmployeeCalculatedAmount(###-##)

Returns the calculated amount from the employee pay code. Replace the (###-##) with the pay code and sub code.

 

Employee Hire Date

EmployeeHireDate

Returns the employee hire date.

 

Employee Length of Service

EmployeeLengthOfService

Returns the total number of full years worked by the employee for the organization based on the hire date and additional years of service.

 

Employee Pay Period Amount Limit

EmployeePayPeriodAmountLimit

Returns the employee pay period limit amount from the employee pay code.

 

Employer Amount Rate Percent

EmployerAmountRatePercent(###-##)

Returns the employer amount, rate, or percent from the employee pay code. Replace the (###-##) with the pay code and sub code.

 

Employer Calculated Amount

EmployerCalculatedAmount(###-##)

Returns the employer calculated amount from the employee pay code. Replace the (###-##) with the pay code and sub code.

 

Employer Pay Period Amount Limit

EmployerPayPeriodAmountLimit

Returns the employer pay period limit amount from the employee pay code.

 

Exemptions

Exemptions(###-##)

Returns the number of exemptions from the employee pay code. Replace the (###-##) with the pay code and sub code.

 

FWT

FWT

Returns the calculated Federal withholding tax as a positive amount.

 

Hourly Rate

HourlyRate

Returns the employee hourly rate.

 

Hours Current Period

HoursCurrPer

Returns the total hours for the current pay period.

 

Hours For Period Pay Code

HoursForPeriodPayCode(###-##)

Returns the employee hours for the current pay period from the employee pay code. This variable will divide the value by the pay period frequency. Replace the (###-##) with the pay code and sub code.

 

Hours Previous Month

HoursPrevMo

Returns the total hours for the previous month. Includes check issue dates from the previous month.

 

Hours Year-to-date

HoursYTD

Returns the total hours for the current year to the calculation date. Does not include hours for the current payroll calculation in the total.

 

IIF

IFF(expr,truepart,falsepart)

Use IFF to make a logical comparison between a value and what you expect. An IFF statement can have two results. The first result is if the statement is true. The second result is if the statement is false.

For example, IFF(SWT>AMT1,0,AMT1) says if SWT is greater than AMT1, then return 0 (zero). If SWT is not greater than AMT1, then return AMT1.

 

MAX

MAX(Amount1, Amount2)

Use MAX to return the largest value in a set of values. The MAX statement can include a logical expression (IFF), a modifier name, or a constant.

For example, MAX(SWT,1000) compares SWT to 1000. If SWT is greater than 1000, then return SWT. If SWT is less than 1000, then return 1000.

 

MIN

MIN(Amount1,Amount2)

Use MIN to return to the smallest value in a set of values. The MIN statement can include a logical expression (IFF), a modifier name, or a constant.

For example, MIN(SWT,1000) compares SWT to 1000. If SWT is greater than 1000, then return 1000. If SWT is less than 1000, then return SWT.

 

Modifier 1-20

ModifierX

Returns a modifier from the Calculation table.  

 

Other Dependents

OtherDependents

Returns an amount based on the number of other dependents from the employee pay code.

 

Other Income

OtherIncome

Returns the other income amount from the employee pay code.

 

Pay Periods

PayPeriods

Returns the total number of pay periods for the employee in a year.

 

Prior Pay Period Number

PriorPayPeriodNumber

Returns the pay period number of the prior pay period.

 

PriorYearWages(###-##)

Returns prior year subject wages. 

 

Result

Result

Returns a total. This is the last line a formula. For example, Result=

 

Round

Round(Amount,Digits)

Use Round to round a number to a specified number of digits. The Round statement includes the variable to round and the number of decimal places.

For example,

  • ROUND(SWT,0) rounds SWT to a whole number.

  • ROUND(AMOUNT,2) rounds AMOUNT to 2 decimal places.

 

SWT

SWT

Returns the calculated state withholding tax as a positive amount.

 

Table

Table(Amount)

Use a calculation table to look up an amount. The Table variable includes the calculation table and the variable to look up.

 

Table Tax Amount

TableTaxAmount(Amount)

Returns the tax amount from a calculation table.

 

Table Tax Rate

TableTaxRate(Amount)

Returns the tax rate from a calculation table.

 

Var 1-25

VarX

Use Var1, Var2, Var3, ... to define variables in a calculation.

For example, Var1 = CurrentExemptions+CurrentAdditionalExemptions

 

Wages Current Month

WagesCurrMo

Returns the total gross wages for the month. Uses the month that includes the pay period end date.

 

Wages Current Period

WagesCurrPer

Returns the total wages for the current period.

 

Wages Current Period Limit Applied

WagesCurrPerLimitApplied

Returns the total wages with the maximum wage limit applied for the current pay period.

 

Wages Previous Month

WagesPrevMo

Returns the total wages for the previous month. Includes check issue dates from the previous month.

 

Wages Previous Period

WagesPrevPer

Returns the total wages for the previous pay period.

 

Wages Year-to-date

WagesYTD

Returns the total wages for the current year to the calculation date (1/1/YYYY to calculation date). Total does not include wages for the current payroll check.

 

 

Operators

Operators specify the type of calculations that you want to perform on the elements of a formula. Connect follows the mathematical rules for calculations, which is parenthesis, multiplication and division, and addition and subtraction. Using parenthesis allows you to change the calculation order.

Operators list

(+) Add

(-) Subtract

(*) Multiple

(/) Divide

(=) Equals

(<>) Is not equal

(>) Greater than

(<) Less than

(<=) Less than or equal

How do I add an operator?

You can use the Operators list to drag and drop an operator in a calculation or you can use the keyboard enter the op=

Operators

 

 

Copyright © 2025 Caselle, Incorporated. All rights reserved.

    • Related Articles

    • What is a calculation formula?

      Use Calculation Formulas to set up a new formula, edit an existing formula, or delete an old formula. All formulas used in the Payroll program are stored in this table. Then, you can use the calculation formula to set up the options in the ...
    • Rate operators list

      Rules and guidelines for using operators in a formula that calculates a rate. Operators (+, -, *, etc.) specify the type of calculation that you want to perform on the elements of a formula. Uses standard mathematical precedence. Arithmetic operators ...
    • How do I use the employee pay code amount for the current period in a calculation formula?

      If your organization calculates pay code amounts based on the pay period, you can use the CurrPerAmtPayCode variable to insert the employee pay code amount for the current period in a calculation formula. Payroll will use the CurrPerAmtPayCode ...
    • How do I add a calculation formula?

      Use Calculation Formulas to set up a new formula, edit an existing formula, or delete an old formula. All formulas used in the Payroll program are stored in this table. Then, you can use Calculations to link together the calculation formula, ...
    • W-2/W-3 Form Variables

      Use the form variables to create a form layout for printing W-2/W-3 Form. Alignment 1099 Dividend Limit 1099 Government Payments Limit 1099 Interest Limit 1099 Miscellaneous Limit 1099 Real Estate Limit 1099 Retirement Limit 1st Local Income Tax 1st ...