Normalize a Doctor Shift Schedule in Excel with Power Query
Question details
Convert a doctor-shift calendar into a normalized array or table where each row represents one doctor and date, with the date in column A, doctor name in column B, and shift details in subsequent columns.

- Product
- Microsoft Excel Power Query
- Device & OS
- not provided
- Scenario
- A calendar-style schedule must be reshaped into a row-based data table for filtering, reporting, or further analysis.
- Observed behavior
- The source data is arranged as a schedule grid rather than a normalized list, so dates, doctor names, and shift fields need to be separated into consistent columns.
Identify which rows contain doctor names and which columns contain dates, shift types, or locations. Convert the source range to an Excel table first so Power Query can detect headers and expand the schedule consistently.
Unpivot the shift calendar with Excel Power Query
Use this method when the schedule is a repeating grid and you need a refreshable normalized table after each schedule update.
Power Query can convert multiple date or shift columns into rows. The exact unpivot columns depend on whether doctors are listed in rows or columns, so confirm the source headers and the fields required in the final output before applying the transformation.
Select the complete schedule range in Excel, including its headers, then choose Insert > Table. Confirm that My table has headers is selected, and give the table clear header names where possible.
Click any cell in the new table, then select Data > From Table/Range to open the Power Query Editor.
In Power Query, select the columns that should remain fixed in the result, such as Doctor, Department, or Shift Type. Use Home > Use First Row as Headers if the correct headers were imported as data.
Select the date or schedule columns that should become rows, then choose Transform > Unpivot Columns. Power Query creates Attribute and Value columns; rename Attribute to Date or Shift Field and rename Value to the appropriate shift-detail name.
Select the Date column and choose Transform > Data Type > Date. Set doctor and shift-detail columns to Text as needed, then select Home > Close & Load to return the normalized table to Excel.

Create a normalized array with Microsoft 365 dynamic-array formulas
Use this option when you need a formula-driven result that updates immediately as the source grid changes and your Excel version supports dynamic-array functions.
Organize Doctor Shift Data into a Usable Table with WPS Spreadsheet
WPS Spreadsheet provides a lightweight workspace for arranging a doctor-shift calendar into a row-based table. Create Date, Doctor, and Shift columns, use formulas to reference or repeat schedule values, and then sort or filter the completed schedule for staffing review.
- 1. Open the schedule workbook: Open the Excel schedule in WPS Spreadsheet and select the worksheet that contains the calendar-style shift grid.
- 2. Add normalized output headers: Create a new worksheet, then enter Date, Doctor, Shift Type, and Shift Details as column headers in row 1.
- 3. Reference schedule values into rows: In the output sheet, enter formulas that reference the date header, doctor-name cell, and corresponding shift cell from the calendar. Fill the formulas down for each doctor-date combination.
- 4. Remove unused entries: Select the output table and use Data > Filter to hide blank Shift Details cells, leaving only scheduled shifts in the list.
- 5. Sort and save the result: Use Data > Sort to order the table by Date and Doctor, then choose Menu > Save As to save the normalized schedule as an .xlsx file.

Frequently Asked Questions
What does a normalized doctor shift schedule look like?
A normalized schedule uses one row per scheduled doctor and date. Typical columns are Date, Doctor, Shift Type, Start Time, End Time, Location, and Notes.
Which columns should I unpivot in Power Query?
Unpivot the repeating schedule columns, usually the columns headed by dates or shift categories. Keep identifying columns such as Doctor, Department, and any fixed schedule attributes unchanged.
Why does Power Query create Attribute and Value columns after unpivoting?
Attribute stores the original column header, such as a date or shift category, and Value stores the cell content from that column. Rename these columns to reflect their actual meaning in the final table.
Can Power Query update the normalized schedule when the calendar changes?
Yes. Keep the source data in an Excel table, update the calendar values, and then choose Data > Refresh All to rerun the Power Query transformation.
Can I use formulas instead of Power Query for a shift schedule?
Yes, if you use Microsoft 365 dynamic arrays. TOCOL can flatten shift values, while HSTACK, FILTER, INDEX, and SEQUENCE can assemble matching Date and Doctor columns; the formula depends on the source layout.




