How to Calculate Shifts and Hours from Multiple Employee Punches in WPS Office
Question details
The user needs to calculate weekly shift counts and average hours per shift from employee clock-in/out punch data without counting break punches as multiple shifts.

- Product
- WPS Office Spreadsheets
- Device & OS
- not provided
- Scenario
- The user has raw employee punch data with multiple clock-in and clock-out rows per day for breaks, and wants accurate shift counts, average hours per shift, and location summaries.
- Observed behavior
- Break punches create multiple In Punch and Out Punch rows per employee-day, and a row-by-row shift count would incorrectly treat those breaks as separate shifts.
Make sure the raw punch data has Employee ID, Location, Work Date, Punch Type, and Timestamp in separate columns, and remove blank or duplicate rows before calculating. Sorting by employee, work date, and timestamp will also make pairing in and out punches easier.
Normalize punch data and pair in/out punches with a shift key
Use this when raw punches are stored as separate rows and break punches need to stay within one shift for an employee-day.
The goal is to keep one transaction per row while assigning a common shift number to all punches that belong to the same employee-day shift. This prevents break punches from creating extra shifts.
Open WPS Office and start a new spreadsheet. Enter or import the data with Employee ID, Location, Work Date, Punch Type, and Timestamp in separate columns, one punch per row.
Select the data range, click Data > Sort, and sort by Employee ID, Work Date, and Timestamp in ascending order so each employee-day is grouped chronologically.
In the new column, use a COUNTIFS formula to increment the shift number for every In Punch row within the same Employee ID and Work Date, then copy that number to the following Out Punch rows for the same shift.
In a Hours column, subtract the previous In Punch timestamp from the Out Punch timestamp for the same Employee ID, Work Date, and Shift Number to get the worked interval.

Aggregate weekly shift counts and average hours per shift with a PivotTable
Use this after the shift key and hours columns are in place to create summaries by employee, location, and week.
Build formula-based weekly summaries with COUNTIFS, SUMIFS, and WEEKNUM
Use this when you need a formula-driven summary outside a PivotTable or want to embed the summary into a dashboard.
Calculate Employee Shifts and Hours in WPS Spreadsheets Without Counting Break Punches as Separate Shifts
WPS Spreadsheets can directly complete this task by helping you normalize punch data, pair in and out punches into one shift per employee-day, and build PivotTable summaries for weekly shift counts, average hours per shift, and location comparisons.
- 1. Open or import the punch data in WPS Spreadsheets: Click Menu > Open to load an Excel XLSX or CSV file, or open a blank workbook and paste the raw punch rows into columns.
- 2. Sort and normalize the data: Confirm the columns for Employee ID, Location, Work Date, Punch Type, and Timestamp. Select the data and go to Data > Sort by Employee ID, Work Date, and Timestamp.
- 3. Create a shift key and hours column: Use a COUNTIFS-based helper column to assign a new shift number only to each In Punch, copy it to the corresponding Out Punch rows, and calculate hours with a timestamp subtraction.
- 4. Build the summary PivotTable: Select the cleaned table, choose Insert > PivotTable, and place Employee ID, Work Date, and Shift Number in Rows. Put Location in Columns or Filters and Hours in Values with Average.
- 5. Review weekly and location results: Group the Work Date row by Days or Weeks, filter locations as needed, and confirm one shift per employee-day.

Frequently Asked Questions
How do I stop break punches from being counted as multiple shifts in WPS Spreadsheets?
Do not treat every In/Out row as a shift. Add a Shift Number helper column that increments only on In Punch rows for the same Employee ID and Work Date, then copy it to the matching Out Punch rows so break punches stay within the original shift.
Can I use a PivotTable to calculate average hours per shift by location?
Yes. After creating Shift Number and Hours columns, select the table, click Insert > PivotTable, drag Location to Columns or Filters, and set the Hours value to Average.
What raw punch columns should I keep for this calculation?
Keep Employee ID, Location, Work Date, Punch Type, and Timestamp in separate columns with one transaction per row. This normalized layout is the recommended starting point.
How do I summarize weekly shift counts and hours?
Add a Week Number column with WEEKNUM, then use a PivotTable and group Work Date by Days or Weeks. Count unique Shift Number values per employee-week and average the Hours column.
Can WPS Spreadsheets open my existing Excel punch file?
Yes. Open the Excel XLSX or CSV file in WPS Spreadsheets, work with the data, and save it back to XLSX or another supported format.




