Salary calculation formulas in Excel are essential tools to help businesses automate the salary calculation process, save time and minimize errors. With the ability to process large and flexible data, Excel has become the top choice for human resource managers in setting up an effective salary system. From basic to advanced functions, Excel provides a full range of tools to build automatic, accurate salary calculation tables that are suitable for the characteristics of each business. 1C Vietnam will guide you on how to apply salary calculation formulas in Excel most effectively for businesses.
Excel is a popular and effective tool for payroll management. Before going into the details of the formulas, let's find out why Excel is popular and what factors need to be prepared.
Using Excel for payroll calculation offers many advantages over traditional manual calculation methods. Here are the main reasons why Excel is the preferred tool for payroll management:
According to a Microsoft survey in 2023, more than 78% of small and medium-sized enterprises in Vietnam used Excel as the main tool for payroll management before switching to specialized software.
To build an effective payroll system in Excel, the following factors need to be carefully prepared:
Detailed timesheet:
Relevant legal regulations:
List of employees and basic information:
Company salary regulations:
Fully preparing the above elements will help the process of building salary calculation formulas in Excel become more convenient and accurate.
Excel offers many powerful functions that can help automate your payroll process. Here are some common functions and how to use them in your payroll.
Logical functions are an important foundation in payroll calculation, allowing to set conditions and classify data according to various criteria.
IF function: This is the most basic function, allowing to perform conditional tests and return corresponding results.
Syntax: IF(logical_test, value_if_true, value_if_false)
Applications in payroll:
Tax Rate Classification Based on Income
Calculating allowances based on job position
Determine performance-based bonuses
Example: Calculating position allowance based on position
=IF(C2="Head of Department", 2000000, IF(C2="Deputy Head of Department", 1500000, 0))
AND and OR functions: Combine multiple conditions in one formula.
AND syntax: AND(logical1, logical2, ...)
OR syntax: OR(logical1, logical2, ...)
Applications in payroll:
Combine with IF to create complex conditions
Determine conditions for special allowances
Example: Calculate toxic allowance for employees working in a workshop with a toxic environment and with more than 2 years of seniority
=IF(AND(D2="Chemical workshop", E2>2), 1000000, 0)
Illustration table of IF formula combined with AND:
NV Code | Full name | Department | Location | Seniority | Hazardous allowance |
NV001 | Nguyen Van A | Manufacture | Chemical workshop | 3 | 1,000,000 |
NV002 | Tran Thi B | Manufacture | Chemical workshop | 1 | 0 |
NV003 | Le Van C | Manufacture | Mechanical workshop | 4 | 0 |
Search and query functions help to look up information from data tables, which is useful when needing to get information from many different sources.
VLOOKUP function: Searches for a value in the first column of a table and returns the value in another column on the same row.
Syntax: VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])
Applications in payroll:
Look up basic salary from salary scale table
Search employee information from list
Determine tax rate from personal income tax table
Example: Look up basic salary based on employee code
=VLOOKUP(A2, BangLuong, 3, FALSE)
INDEX and MATCH functions: Combining these two functions allows for more flexible searching than VLOOKUP.
INDEX syntax: INDEX(array, row_num, [column_num])
MATCH syntax: MATCH(lookup_value, lookup_array, [match_type])
Applications in payroll:
Search data by multiple criteria
Look up information from a table with multiple columns and rows
Example: Find salary based on position and seniority
=INDEX(BangLuong, MATCH(C2&D2, ViTri&ThamNien, 0), 5)
VLOOKUP formula illustration table:
NV Code | Full name | Salary coefficient | Basic salary | Allowance | Total income |
NV001 | Nguyen Van A | =VLOOKUP(A2, BangHeSo, 2, FALSE) | =C2*3000000 | =VLOOKUP(A2, BangPhuCap, 2, FALSE) | =SUM(D2:E2) |
NV002 | Tran Thi B | =VLOOKUP(A3, BangHeSo, 2, FALSE) | =C3*3000000 | =VLOOKUP(A3, BangPhuCap, 2, FALSE) | =SUM(D3:E3) |
Aggregate functions help summarize data based on various conditions, which is useful for calculating total income or deductions.
SUM function: Calculates the sum of values.
Syntax: SUM(number1, [number2], ...)
Applications in payroll:
Calculate total income from multiple sources
Calculate total deductions
Example: Calculate total income
=SUM(D2:G2)
SUMIF and SUMIFS functions: Sum values that satisfy one or more conditions.
SUMIF syntax: SUMIF(range, criteria, [sum_range])
SUMIFS syntax: SUMIFS(sum_range, criteria_range1, criteria1, [criteria_range2, criteria2], ...)
Applications in payroll:
Calculate total salary by department
Calculate total overtime hours according to conditions
Calculate total personnel costs by position
Example: Calculate total overtime hours on weekdays
=SUMIF(C2:C32, "Weekday", D2:D32)
Example: Calculate the total salary of employees with more than 3 years of seniority and in the sales department.
=SUMIFS(F2:F100, D2:D100, ">3", B2:B100, "Business")
SUMIF formula illustration table:
Day | Staff | Date Type | Overtime hours | Unit price | Total amount |
03/01/2025 | Nguyen Van A | Weekday | 2 | 50000 | =D2*E2 |
03/02/2025 | Nguyen Van A | Day off | 4 | 100000 | =D3*E3 |
03/03/2025 | Nguyen Van A | Weekday | 1 | 50000 | =D4*E4 |
Total overtime hours on weekdays: | =SUMIF(C2:C4, "Weekday", D2:D4) | ||||
Total overtime pay: | =SUM(F2:F4) |
Date data processing functions help accurately calculate working days, holidays, and other time-related information.
DATE function: Creates a date value from year, month, day.
Syntax: DATE(year, month, day)
Applications in payroll:
Determine the start and end dates of the pay period
Calculate employee age or seniority
Example: Create first and last day of month
First day of the month: =DATE(2025, 3, 1)
Last day of the month: =DATE(2025, 3, 31)
NETWORKDAYS function: Calculates the number of working days between two dates, excluding weekends and holidays.
Syntax: NETWORKDAYS(start_date, end_date, [holidays])
Applications in payroll:
Calculate the actual number of working days in a month
Calculate valid leave days
Example: Calculate the number of working days in March 2025
=NETWORKDAYS(DATE(2025,3,1), DATE(2025,3,31), DateLe)
Where NgayLe is a range of cells containing a list of holidays during the year.
NETWORKDAYS formula illustration table:
Staff | Start date | End date | Number of working days | Daily wage | Total amount |
Nguyen Van A | 03/01/2025 | March 31, 2025 | =NETWORKDAYS(B2, C2, $H$2:$H$10) | 300000 | =D2*E2 |
Tran Thi B | 05/03/2025 | March 31, 2025 | =NETWORKDAYS(B3, C3, $H$2:$H$10) | 350000 | =D3*E3 |
List of holidays (cells H2:H10):
Creating an automated payroll in Excel requires proper structure design and application of appropriate payroll formulas. Here is a detailed guide on how to design and apply formulas to a payroll.
An effective payroll needs to be clearly structured, easy to follow, and easy to update. Here are some guidelines for designing a standard payroll structure:
Step 1: Create a basic information sheet
Create a separate sheet containing basic employee information
Required columns: Employee code, Full name, Date of birth, Department, Position, Date of employment, Basic salary, Account number, Number of dependents
Step 2: Create timesheet sheet
Design a table to track each employee's working days
Required columns: Employee code, Full name, days of the month (1-31), Total working days, Overtime hours (weekdays, weekends, holidays)
Step 3: Create main payroll sheet
Design a payroll spreadsheet with complete information
Required columns:
Basic information: Employee code, Full name, Department, Position
Working day information: Standard working day, Actual working day, Vacation day, Unpaid leave day
Income information: Basic salary, Daily salary, Allowance, Overtime pay, Bonus, Total income
Deduction information: Social Insurance (8%), Health Insurance (1.5%), Unemployment Insurance (1%), Personal Income Tax, Advance, Total deduction
Actual Information: Actual, Notes
Step 4: Create auxiliary sheets
Parameter sheet: Contains fixed parameters such as regional minimum wage, social insurance rate, personal income tax table
Report Sheet: Summary and analysis of salary data
Suggestions for arranging scientific data:
Use employee code as primary key to link between sheets
Name data ranges for easy reference in formulas
Use conditional formatting to highlight important information
Lock cells containing formulas to prevent accidental modifications
Once you have designed your payroll structure, the next step is to apply payroll formulas in Excel to automate the calculation process.
Step 1: Calculate actual working days using the COUNTIF function
To calculate actual working days based on timesheet:
=COUNTIF(BangChamCong!C2:AG2, "X")
In there:
BangChamCong!C2:AG2 is a range of cells containing employee timekeeping information.
"X" is the symbol that marks the working day.
Or use NETWORKDAYS to calculate the number of working days in a period:
=NETWORKDAYS(DayBatDau, DayKetThuc, DanhSachDayLe) - SongayNghiKhongLuong
Step 2: Calculate salary by working day
Salary calculation formula based on actual working days:
=IF(TodayCongChuan>=TodayCongChuan, Salary, Salary/TodayCongChuan*TodayCongThucTe)
Step 3: Calculate overtime pay
Formula for calculating overtime pay on weekdays:
=ROUND((LuongCoBan/DayCongChuan/8)*1.5*SoGioLamThemDayThuong, 0)
Formula for calculating overtime pay on holidays:
=ROUND((LuongCoBan/DayCongChuan/8)*2*SoGioLamThemDayNghi, 0)
Formula for calculating overtime pay on holidays:
=ROUND((LuongCoBan/DayCongChuan/8)*3*SoGioLamThemngayLe, 0)
Step 4: Calculate insurance premiums
Formula for calculating social insurance (8%):
=MIN(Salary*8%, 20*Salary*8%)
Formula for calculating health insurance (1.5%):
=MIN(Salary*1.5%, 20*Salary*1.5%)
Formula for calculating BHTN (1%):
=MIN(Salary of the Company*1%, 20*Salary of the Company*1%)
Step 5: Calculate personal income tax
Formula for calculating taxable income:
=TotalImport - TotalInsurance - 11000000 - Number ofPatients*4400000
Formula for calculating personal income tax using VLOOKUP function and tax table:
=IF(ThuNhapChiuThue<=0, 0, VLOOKUP(ThuNhapChiuThue, BangThue, 2, 1) + (ThuNhapChiuThue - VLOOKUP(ThuNhapChiuThue, BangThue, 3, 1))*VLOOKUP(ThuNhapChiuThue, BangThue, 4, 1))
Step 6: Calculate the net salary
Formula for calculating net salary:
=TotalImports - TotalExports
To improve efficiency and accuracy when using payroll formulas in Excel, here are some useful tips to optimize your workflow.
Conditional Formatting is a powerful tool for quickly detecting unusual values or errors in payroll spreadsheets.
Tip 1: Highlight outliers
How to do:
Tip 2: Create a visual progress bar
How to do:
Tip 3: Use Icon Sets to Categorize Performance
How to do:
PivotTable is a powerful tool that helps analyze and summarize salary data in a flexible and intuitive way.
Tip 1: Create a summary report of salary expenses by department
Tip 2: Analyze salary trends over time
Tip 3: Compare income structure between employee groups
In addition to basic Excel salary calculation formulas, using advanced functions will help optimize the salary calculation process and increase the flexibility of the spreadsheet.
Tip 1: Use the SUMPRODUCT function instead of multiple SUMIF functions
The SUMPRODUCT function allows you to calculate the sum of products of ranges of numbers, which is very useful when you need to calculate sums with complex conditions.
Example: Calculate total overtime pay based on day type and number of hours
=SUMPRODUCT((TypeDay="Weekday")*(Number of Hours)*(DonPrice))
Tip 2: Use the IFERROR function to handle errors
The IFERROR function helps handle error cases in formulas, avoiding displaying unwanted error messages.
Example: Calculate salary increase rate compared to last month
=IFERROR((This Month's Salary-Previous Month's Salary)/Previous Month's Salary, "N/A")
Tip 3: Use the INDIRECT function for dynamic references
The INDIRECT function allows you to create dynamic references to cells or ranges of cells, which is useful when you need to get data from multiple sheets.
Example: Get data from sheet corresponding to current month
=INDIRECT("'"&B1&"'!C5")
Where B1 contains the sheet name (for example: "March Salary")
Tip 4: Use Data Validation to control input data
Data Validation helps control input data, avoiding errors due to incorrect data entry.
How to do:
Select the data area to control
Go to Data > Data Validation
Set up validation conditions (e.g. limit number of working days from 0-31)
Add error message when entering wrong information
Tip 5: Use Name Manager to manage data areas
Name Manager helps you name data ranges, making formulas easier to read and maintain.
How to do:
Go to Formulas > Name Manager
Click New to create a new name
Enter a name (for example, Salary) and reference a cell or range of data.
Use this name in formulas instead of cell references
For example: Instead of =A1*8%, you can write =Basic Salary*Social Insurance Benefits
Salary calculation formulas in Excel are powerful tools that help businesses automate and optimize the salary management process. From basic functions such as IF, SUM to advanced functions such as VLOOKUP, INDEX-MATCH, Excel provides a full range of tools to build an accurate, flexible and effective salary calculation system. Applying the right formulas combined with a reasonable spreadsheet design not only saves time but also minimizes errors, ensuring transparency in human resource management. 1C Vietnam always accompanies businesses in optimizing the salary management process through the application of modern technology.