Attendance sheets, combined without double-counting
Attendance data has one property that makes naive merging wrong: the same person appears in many files, and the same day can appear twice after a correction.
Key on person + date, not person
The unique key is (employee, date). Group on that pair and take one row per pair — preferring the later submission when two exist, since that is the correction. Grouping on employee alone collapses a month into one row.
Durations vs clock times
Files come in two shapes: clock-in/clock-out times, or a duration in hours. Do not mix them in one column. If you need hours, compute out − in − break and handle the overnight case where out < in.
Step by step
- Merge all files; keep the source-file column.
- Clean dates to real dates and times to real times.
- Deduplicate on (employee, date), keeping the later source file.
- Compute hours per row; sum per employee per month.
- Sanity-check: total days should not exceed calendar days in the period.
What goes wrong
Overnight shifts
22:00 → 06:00 is negative if you subtract naively. Add 24 hours when out < in.
Name variants
"Zhang Wei", "Zhang Wei", "张伟" — pick an employee ID as the key, not a name.
Questions people actually ask
Can I get a monthly summary per person?
Yes: group by (employee, month) after computing hours per row.
What about public holidays?
Keep a small calendar table and join on date — do not encode holiday rules in the merge.
Do it now, in this browser
Drop the folder in, check the detected header, merge. Nothing is uploaded — the file is processed in the tab. Free for one-off merges; the unlimited local build is $9.