Calculation Issues

How to Calculate Shifts and Hours from Multiple Employee Punches in WPS Office

Aamir Naveed AkramAamir Naveed Akram Nov 13, 2026 869 views

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.

How to Calculate Shifts and Hours from Multiple Employee Punches in WPS Office
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.
Before you start

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.

Solution 1Recommended

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.

1
Create normalized columns in WPS Spreadsheets

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.

2
Sort the punch rows by employee, date, and time

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.

3
Add a Shift Number helper column

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.

4
Calculate hours for each paired out-punch

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.

Normalize punch data and pair in/out punches with a shift key
Break punches stay in the same shift: Because only In Punch rows create a new shift number, the Out/In pair for a break remains under the original shift instead of being counted as separate shifts.

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. 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. 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. 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. 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. 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.
Pairs break punches into the same shift so shift counts stay accurateCreates weekly and location summaries with PivotTables and formulasOpens and saves Microsoft Excel XLSX and CSV files with format compatibilityFree, lightweight, and familiar spreadsheet interface for employee time analysis
QA img-9

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.