Power Query Problems

How to Convert Weekly Holiday Hours into a Flat Date List in Excel

Olivia MillerOlivia Miller Nov 10, 2026 869 views

Question details

The user needs to transform a crosstab table of weekly holiday hours (with years and weeks in rows, and weekdays in columns) into a flat list showing specific dates, employee numbers, and holiday codes.

How to Convert Weekly Holiday Hours into a Flat Date List in Excel
Product
Excel
Device & OS
not provided
Scenario
Flattening a complex timesheet or holiday schedule for database import, pivot table analysis, or payroll processing.
Observed behavior
The data is currently structured in a matrix format that is difficult to analyze or filter compared to a standard flat data table.
Before you start

Ensure your source data is organized as an official Excel Table by pressing Ctrl+T, and back up your original workbook before applying extensive data transformations.

Solution 1Recommended

Unpivot Data using Power Query

Power Query is the most efficient method to flatten crosstab data. By unpivoting the weekday columns, you can easily generate a flat date list.

Power Query allows you to transform matrix-style data into a flat, tabular format without writing complex VBA code or formulas. The 'Unpivot Columns' feature is specifically designed to handle this exact data transformation scenario efficiently.

1
Load data to Power Query

Select any cell in your data table, navigate to the 'Data' tab on the ribbon, and click 'From Table/Range' to open the Power Query Editor.

2
Unpivot the weekday columns

Select the columns that identify the record (e.g., Year, Week, and Employee Number). Right-click one of the selected column headers and choose 'Unpivot Other Columns'.

3
Rename columns

Double-click the newly created 'Attribute' column header to rename it to 'Weekday', and rename the 'Value' column to 'Holiday Code' or 'Hours'.

4
Calculate calendar date

Go to the 'Add Column' tab and click 'Custom Column'. Write a formula using the Year, Week, and Weekday columns to calculate the exact calendar date.

5
Load the flattened data

Click 'Close & Load' on the Home tab to output the newly flattened data table into a new Excel worksheet.

Dynamic Updates: Once the Power Query connection is set up, you can simply click 'Refresh All' on the Data tab whenever your source holiday hours table is updated.

Flatten Holiday Data Efficiently with WPS Spreadsheet

WPS Spreadsheet provides robust data handling capabilities, including comprehensive formula support and pivot tables, to help you transform complex weekly timesheets into flat lists with ease.

  1. 1. Open your dataset: Launch WPS Spreadsheet and open your holiday hours matrix document.
  2. 2. Setup the flat table structure: Create a new worksheet with designated columns for Date, Employee Number, and Holiday Code.
  3. 3. Apply mapping formulas: Use WPS Spreadsheet's built-in INDEX and MATCH formulas to map the crosstab data accurately into your new flat columns.
  4. 4. Finalize as static values: Once populated, copy the formula results and paste them as values to finalize your flat date list and improve spreadsheet performance.
High performance for large data transformationsSeamless compatibility with Microsoft Excel formulas (.xlsx)Intuitive interface for formula creation and auditing
microsoft office alternative - wps office

Frequently Asked Questions

Why is a flat list better than a weekly matrix for holiday hours?

A flat list (tabular data) is the standard format required for Pivot Tables, database imports, and advanced data analysis. It allows the software to easily filter, group, and aggregate records by specific dates or employees.

Can I automate the unpivoting process in Excel?

Yes. By using Power Query, the transformation steps you apply are saved as a repeatable query. You just need to click 'Refresh' on the Data tab whenever new data is added to the source table.

How do I calculate an exact date from a year and a week number?

You can calculate the date by finding the first day of the given year using the DATE function, adding the number of weeks multiplied by 7, and adjusting the offset for the specific weekday using the WEEKDAY function.

What if my raw data has blank cells for days without holidays?

When using the 'Unpivot Other Columns' feature in Power Query, blank or null cells are typically excluded by default. This helps keep your final flat list clean and prevents non-holiday dates from generating unnecessary rows.