A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data
Dear Levigarret,
Thanks for reaching out again! As I researched, to ensure your dataset works smoothly with an Excel Gantt chart template, we need to adjust the format so that Excel can interpret the project timelines correctly.
Key Adjustments Needed
Your current dataset is structured in a wide format, with months as column headers. However, most Gantt chart templates require a long format, where each row represents a task with its start date and duration.
Automated Method for Reformatting
To transform your data efficiently, I recommend using Power Query in Excel:
- Load Data into Power Query
- Select your table > Go to Data > Click From Table/Range.
- Unpivot Month Columns
- In the Query Editor, select all columns except Project, Product, Employee, Role, and Activity.
- Right-click > Unpivot Other Columns.
- This will restructure your data into rows like: Project 4 – A | RE1 Mech | Month = Jan-2025 | Hours = 75
- Filter Out Empty or Zero Values
- Click the dropdown on Hours, uncheck 0 and null values to keep only active work periods.
- Group Data to Find Start and Duration
- Go to Home > Group By >
- Group by: Project/Product/Employee/Role/Activity
- New column “Start” = Min of Month
- New column “End” = Max of Month
- Add a Custom Column to calculate duration:
m
Duration = List.Count({[Start]..[End]})
- Close & Load Data Back to Excel
- You now have a structured table with Task, Start Date, and Duration, ready for a Gantt chart template.
If you prefer staying within Excel formulas, you’d need a dynamic array formula that: Extracts non-zero (Task, Month) pairs using FILTER(). Identifies the first and last month per task. Calculates duration
This method is more complex, so Power Query is the recommended approach for automation.
I hope my information helps, if you have any further questions then don't hesitate to reach out again. I’m happy to assist!
Best regards,
Kristen - L - MSFT | Microsoft Community Support Specialist.