powerquery automation

How to Calculate Weekday and Holiday Workdays Automatically with Power Query

minbe-data 2026. 6. 4. 08:21

thumnail

 

Tracking employee workdays can be difficult when working hours are recorded across multiple day columns.

In many attendance sheets, employees are listed in rows while daily work hours are stored horizontally.

In this example, Power Query automatically:

- Converts daily work hours into a structured table
- Identifies weekdays and holidays
- Applies custom workday rules
- Counts qualifying weekday workdays
- Counts qualifying holiday workdays
- Creates an employee attendance summary

The result updates automatically whenever work hours are changed and the query is refreshed.

This method is useful for payroll processing, attendance management, HR reporting, and workforce analysis.

 

before

 

after

 

videolink - https://youtu.be/CIfnvD0Nxn4

 

explanation.txt
0.00MB

 

 

Download the sample file below.

You can download the zip file in [Download] page

The file name is 47.overtime_workday_count.zip

Use the English M code provided for your dataset.

You may need to manipulate the M code under your circumstance. You consider this point and use M code

below txt file is detailed-explanation. You use M code in reference with this explanation.

 

---------------------------------------------------------

Need a custom automation for your Excel workflow?

I can build a tailored solution based on your data.

✔ Used in real-world business automation  
✔ Saves hours of manual work

minbedata@gmail.com

You can pay via PayPal.

You don't worry about conversing with me.

My Major is an English literature, so I can speak English fluently and read, listening, writing proficiently

korean version web address (한국버전) is 

<a href="https://blog.naver.com/minbe-data" target="_blank">네이버 블로그 바로가기</a>