---
schema_version: "1"
id: f6717a86cbe0785b19088eb8986295e4f47cbf4d6f5a192eeed241e7a261e8d2
title: Sample Employee Services Formulas
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/platform/264-0-0/useful_advanced_formulas_employee_svcs.md
canonical_url: https://help.salesforce.com/s/articleView?id=platform.useful_advanced_formulas_employee_svcs.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 8ab6b56111e0264559911801f205a6424c543631b00401a4a4b8d9ff4af0d6b2
description: Calculate bonuses, 401(k) matching, weekly hours worked, and regular and overtime pay.
products:
  - Salesforce Platform
  - Security
release: "264"
---
# Sample Employee Services Formulas

Calculate bonuses, 401(k) matching, weekly hours worked, and regular and overtime pay.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: both Salesforce Classic and Lightning Experience</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>Essentials</strong>, <strong>Group</strong>, <strong>Professional</strong>, <strong>Enterprise</strong>, <strong>Performance</strong>, <strong>Unlimited</strong>, and <strong>Developer</strong> Editions</td></tr></tbody></table>

For details about using the functions included in these samples, see [Formula Operators and Functions](https://help.salesforce.com/s/articleView?id=platform.customize_functions.htm&release=264.0.0&type=5 "Use these operators and functions when building formulas. All functions are available everywhere that you can include a formula, such as formula fields, validation rules, approval processes, and workflow rules, unless otherwise specified.").

## Bonus Calculation

This example determines an employee's bonus amount based on the smallest of two amounts: the employee's gross income times a bonus percent or an equally divided amount of the company's performance amount among all employees. It assumes you have a custom number field for Number of Employees, a custom percent field for Bonus Percent, and currency custom fields for the employee's Gross and company's Performance.

```
MIN(Gross__c * Bonus_Percent__c, ​
  Performance__c / Number_of_Employees__c)
```

## Employee 401K

This example formula determines which amount to provide in employee 401K matching based on a matching program of half of the employee's contribution or $250, whichever is less. It assumes you have a custom currency field for Contribution.

```
MIN(250, Contribution__c /2)
```

## Hours Worked Per Week

This formula uses a custom tab to enable time tracking of hours worked per day. It uses a formula field to sum the hours per week.

```
MonHours__c + TuesHours__c + WedsHours__c + ThursHours__c + FriHours__c
```

## Total Pay Amount

This formula determines total pay by calculating regular hours multiplied by a regular pay rate, plus overtime hours multiplied by an overtime pay rate.

```
Total Pay = 
IF(Total_Hours__c <= 40, Total_Hours__c * Hourly_Rate__c, 
40 * Hourly_Rate__c + 
(Total_Hours__c - 40) * Overtime_Rate__c)
```