Create a Gantt Chart in Excel with a Pivot Table?

Charts & pivot tables · Updated November 3, 2026

Create a Gantt Chart in Excel with a Pivot Table?

Yes—but a PivotTable does not have a built-in Gantt view. In Excel for Microsoft 365 on Windows, summarize task start dates and durations in a PivotTable, then use a stacked bar chart to show each task as a timeline; a regular chart based on the summary is often easier to format than a PivotChart.

What a PivotTable can and cannot do

A Gantt chart displays tasks as horizontal bars positioned along a date axis. The bar’s position represents the start date, and its length represents the task duration. Excel does not offer Gantt as a dedicated PivotTable layout or standard chart type. The usual workaround is a stacked bar chart: the first series creates an invisible offset from the beginning of the timeline, and the second series draws the visible task bar.

A PivotTable can organize or summarize the information used for that chart. For example, it can group tasks by project or owner and display a start date and duration for each task. You can then make a PivotChart from that summary, or use the PivotTable results as the source for a regular stacked bar chart. The second option gives you more control over the chart and can be less vulnerable to PivotChart formatting limitations.

The key distinction is that the PivotTable supplies and reshapes the data; the stacked bar chart supplies the Gantt-style visual. Neither option automatically adds project dependencies, progress shading, or calendar-aware working days.

Prepare the task data first

Start with a simple source table, with one row per task. Useful columns include Project, Task, Owner, Start Date, Finish Date, and Duration. Use real Excel dates in the date columns, not text that only looks like a date. Select the data and choose Insert > Table so new task rows can be included more reliably when the source expands.

For a basic calendar-day schedule, calculate duration from the start and finish dates. With the start date in B2 and the finish date in C2, enter this formula in D2:

=C2-B2+1

For example, if a task starts on June 3 and finishes on June 7, the inclusive duration is five days. The plus one counts both the start and finish dates. If your project convention counts elapsed days rather than inclusive calendar dates, use =C2-B2 instead; a same-day task then has a duration of zero, so decide how you want such tasks shown.

Check the source before building the summary:

  • Confirm that every task has a start date and a finish date, and that the finish is not earlier than the start.
  • Use a stable task identifier or include the project name when task names may repeat.
  • Decide whether duration means calendar days or working days. The simple subtraction formula counts weekends and holidays.
  • Keep one row per task unless repeated rows intentionally represent separate work components.

Build a PivotTable summary

Click a cell in the source table and choose Insert > PivotTable. Select where to place the PivotTable and confirm. In the PivotTable Fields pane, drag Task to Rows. If useful, place Project or Owner above Task in Rows to create a hierarchy, or add Owner to Filters so you can focus on one person.

Drag Start Date to Values. Excel may initially try to sum dates, which is not useful for a timeline. Open the field’s drop-down in the Values area, choose Value Field Settings, and under Summarize Values By select Min. Format the resulting values as dates if Excel displays serial numbers. For a source with one row per task, Min returns that task’s start date.

Drag Duration to Values as well. Sum is appropriate when each task appears once and the PivotTable is showing the task itself. If repeated rows are duplicates or alternative records for the same task, summing their durations would inflate the bar. Clean or summarize those records first rather than assuming the PivotTable knows which one represents the actual schedule.

A PivotTable is most useful when you need to filter or group the schedule. A summary with one row per task will still show individual task bars; grouping only by owner or project instead will show totals or group-level values, not the separate schedule of every task. Check that the displayed start and duration represent the intended task-level data before charting.

Create the stacked bar Gantt chart

To create a PivotChart directly, click inside the PivotTable and choose PivotTable Analyze > PivotChart. In the chart selection dialog, choose Bar and then Stacked Bar. Confirm that Task is the category field and that the chart has two value series: the summarized start date and duration. A stacked bar chart is important; a clustered bar chart places the series beside each other instead of using the start date as an offset.

Now hide the start-date series so only the duration bars remain visible at their correct positions. Select a bar belonging to the start-date series, open Format Data Series, and set its fill to No Fill. Leave the duration series filled with a visible color. The empty first series still occupies space in the stack, positioning each duration bar at its start date.

If the PivotChart is awkward to format, make a small chart-ready range next to the PivotTable with Task, Start Date, and Duration, then insert a regular chart from that range. Choose Insert > Insert Column or Bar Chart > 2-D Bar > Stacked Bar. Hide the Start Date series with No Fill in the same way. A normal chart is not itself a PivotChart, but it can still reflect refreshed summary values if its source range points to them.

Format the timeline and task labels

Improve readability by selecting the vertical category axis and using Format Axis. Under Axis Options, turn on Categories in reverse order if you want the first task at the top. Adjust the horizontal date axis so its minimum and maximum cover the project period rather than a much wider span. Excel stores dates as serial numbers, so set the axis number format to a date format if it appears as a sequence of numbers.

Useful finishing touches include reducing the gap between bars, applying one clear color to duration, and adding a chart title. If the schedule is long, use a sensible date range and keep labels concise. For a schedule with months or weeks, choose an axis scale that makes milestones and task lengths distinguishable without crowding the labels.

Remember that the hidden start series is a formatting trick, not missing data. If you change chart type or rebuild the chart, the start series may become visible again. Reapply No Fill and check the axis range after significant changes to the schedule.

Refreshes, filters, and PivotChart behavior

When source data changes, refresh the PivotTable using PivotTable Analyze > Refresh, or right-click the PivotTable and choose Refresh. A PivotChart linked to that PivotTable updates with it. If you add rows, using an Excel Table as the source helps the range expand; if the new rows are not included, check the PivotTable source through PivotTable Analyze > Change Data Source.

PivotChart filters can be useful for narrowing a large plan by project, owner, or status. However, filters also change which task bars are visible, so confirm that the chart has not hidden tasks you meant to include. A regular chart connected to a fixed range may not include new summary rows automatically; use a suitable expanding source or update its chart data range when the PivotTable grows.

For a task with a start date but no finish date, decide whether it should be excluded, assigned a planned finish, or displayed as a milestone. A blank duration cannot produce a meaningful bar. Likewise, a PivotTable cannot infer task dependencies from dates; dependency arrows and automatic rescheduling require additional setup or another project-planning tool.

Common problems and how to fix them

  • The bars start at zero or look like long blocks: the Start Date field may be summed, or the chart may not be stacked. Set the date summary to Min and choose Stacked Bar.
  • The start-date series is visible: select that series and set its fill to No Fill. Confirm you selected the start series, not Duration.
  • Dates show as large numbers: format the axis or PivotTable values as dates. Excel stores dates numerically, even when it displays them as calendar dates elsewhere.
  • Durations are too large: check for duplicate source rows and confirm the chosen aggregation is appropriate. Sum is not correct for duplicate copies of the same task.
  • Tasks appear in an unexpected order: reverse the category order in Format Axis or sort the PivotTable by a task sequence field.
  • New tasks do not appear: refresh the PivotTable and verify its source includes the new rows.

When to use another approach

Use the PivotTable route when the schedule needs interactive grouping or filtering, such as comparing tasks across project owners. If the plan is small and each task already has one clean row, a regular stacked bar chart from the source table may be faster. It avoids the extra summary step and makes it straightforward to keep one bar per task.

For working-day schedules, calculate duration using a working-day function such as NETWORKDAYS, with an optional holiday range, rather than subtracting dates. Make sure the chart’s start offset and duration use compatible units; a duration counted in workdays will not align perfectly with an axis that represents every calendar day. For dependencies, baselines, resource leveling, or automatic schedule changes, dedicated project-management software may be more suitable than a manually maintained Excel chart.

Frequently Asked Questions

Can Excel make a Gantt chart from a PivotTable?

Excel does not provide a dedicated Gantt PivotTable view. You can make a stacked bar PivotChart from summarized start dates and durations, or build a regular stacked bar chart using the PivotTable output as its data source.

Is a PivotChart required?

No. A regular stacked bar chart can use a PivotTable summary, and it often gives you more direct control over chart formatting. A PivotChart is useful when you want chart filters and series to stay tied to the PivotTable.

Why does my Gantt chart show the start dates as bars?

The start dates are the hidden offset series that position the duration bars. Select that series and set its fill to No Fill. If the dates are being added together, change the PivotTable’s Start Date value setting to Min.

Can I show weekends or working days?

A standard date-axis chart spans calendar time, including weekends. You can calculate task durations in working days, but those durations will not map cleanly to a calendar-day axis without additional design. For a basic Gantt chart, keep the duration unit consistent with the timeline.

Will the chart update when I add a task?

Refresh the PivotTable after adding source data. If the new task is outside the PivotTable’s source range, change the data source or use an Excel Table as the source so added rows can be included more easily. A regular chart may also need its data range extended.

Related

Try it: the Percentage Formula Generator: percent of, percent change, increase and decrease, with the formula.

More in Charts & pivot tables

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.