For a basic Excel Gantt chart, calculate each task’s finish date with =B5+C5-1 when B5 is its start date and C5 is its inclusive duration in calendar days; then use =AND(F$4>=$B5,F$4<=$D5) as a conditional-formatting rule for the date grid. The first formula calculates the task dates, and the second colors the timeline cells that fall between each task’s start and finish.
What the date formulas do
A Gantt chart places tasks in rows and dates across columns. A colored cell marks the period when a task is scheduled. Excel stores dates as serial numbers, so adding 1 to a date moves it forward by one calendar day. That makes a simple formula-based chart possible: calculate each task’s end date, create a sequence of dates across the top, and apply conditional formatting to the cells between the start and end.
The minus 1 in the finish-date formula matters. If a task starts on April 1 and lasts one day, its finish date should also be April 1, not April 2. With a duration of five calendar days, the inclusive finish date is April 5. The formula assumes duration means the number of calendar dates occupied, including the start date.
Set up the worksheet
Use a layout like this in a blank worksheet. The exact columns can differ, but consistent references make the formulas easier to follow:
- Column A: task name.
- Column B: start date.
- Column C: duration in calendar days.
- Column D: finish date, calculated by formula.
- Row 4, beginning in column F: timeline dates.
- Rows 5 onward: task details and the cells where bars will appear.
For example, enter a task called Design in A5, a start date of April 1, 2026 in B5, and a duration of 5 in C5. Put a finish-date heading in D4. With the task start date in B5 and its duration in C5, enter this in D5:
=B5+C5-1
The result is April 5, 2026. Format B5 and D5 as dates if Excel displays serial numbers instead. To apply the formula to more tasks, fill D5 down the column; relative references will adjust for each row.
Create the timeline dates
Choose a project start date in B2. In F4, place the first timeline date by referencing that cell. Assuming B2 contains the project’s first date, enter this in F4:
=$B$2
For the next date, with F4 holding the first date, enter this in G4:
=F4+1
Drag G4 to the right to extend the daily timeline. Each column advances by one calendar day. Format the timeline cells as dates, then adjust column widths so the headings are readable. You can use a shorter display such as day numbers, but keep the underlying values as real Excel dates so the conditional-formatting comparison works.
If you prefer to start at the earliest task date rather than enter a project start date separately, Microsoft 365 or Excel 2021 can calculate it from the task list. With task start dates in B5:B20, enter this in F4:
=MIN(B5:B20)
That returns the earliest date in the range. It does not automatically determine how many timeline columns are needed; extend the date row far enough to cover the latest task finish.
Color the Gantt bars with conditional formatting
Select the task-date area, for example F5:AZ20. On Excel for Microsoft 365 on Windows, choose Home > Conditional Formatting > New Rule > Use a formula to determine which cells to format. With the first task in row 5, the first timeline date in F4, start dates in column B, and finish dates in column D, use:
=AND(F$4>=$B5,F$4<=$D5)
Choose a fill color in the formatting dialog and confirm the rule. The formula tests each date heading against that row’s start and finish. The dollar signs lock the header row and the start and finish columns while allowing Excel to adjust the date column and task row across the selected range. If your data starts on another row or the timeline begins in another column, update the references to match the top-left cell of the selected range.
On Excel for Mac, the same basic approach is available through Home > Conditional Formatting > New Rule; the wording and arrangement of the dialog can vary by release. Excel for the web also supports conditional formatting, though some dialog controls differ. The formulas here use commas as argument separators, as in English-language Excel installations; regional settings may use semicolons instead.
Calendar days versus working days
The basic finish formula counts weekends and holidays. That is appropriate when the work occupies continuous calendar time, such as a review period that runs for seven days. For a task scheduled only on weekdays, use Excel’s WORKDAY function instead. With the task start in B5, the number of working days in C5, and holiday dates listed in J2:J10, enter this in D5:
=WORKDAY(B5,C5-1,$J$2:$J$10)
If B5 is Monday, April 6, 2026, C5 is 5, and there are no listed holidays in that week, the result is Friday, April 10, 2026. WORKDAY skips Saturday, Sunday, and the supplied holiday dates. The start date should itself be a working day for the inclusive-duration interpretation to match the example. If the task begins on a weekend, decide whether it should move to the next workday or whether the schedule needs a different convention.
For a workweek other than Saturday and Sunday, Excel also provides WORKDAY.INTL, which lets you define weekend days. If using it, check the function’s weekend argument and holiday list against the organization’s actual schedule. A project calendar with shifts, partial workdays, or different hours may require more than a date-only Gantt chart.
Show nonworking days and improve readability
Weekends can be shaded lightly so readers can distinguish calendar time from working time. For a timeline in row 4 beginning at F4, apply another conditional-formatting rule to the date grid using:
=WEEKDAY(F$4,2)>5
Set a subtle fill and place this rule on the task grid. WEEKDAY with a return type of 2 numbers Monday as 1 through Sunday as 7, so values greater than 5 identify Saturday and Sunday. If the weekend shading obscures the task-bar color, move or adjust the rules in Conditional Formatting > Manage Rules. You can also leave weekends unshaded and use borders or date labels for clarity.
Other practical choices include freezing the task-name columns while scrolling across a long schedule, using a consistent color per project phase, and showing milestones as a separate symbol or dedicated column. Avoid relying on color alone: label task rows clearly, use readable date headings, and consider a legend if several colors represent different meanings.
Common date and formula problems
- The cells show numbers: Excel stores dates as serial values. Apply a date number format using Home > Number Format, or use Ctrl+1 on Windows to open Format Cells. On Mac, use Command+1.
- No bars appear: Check that the conditional-formatting range includes the task rows and timeline columns, and that the formula references the correct start, finish, and header cells. Also confirm that the start and finish entries are actual Excel dates, not text that only looks like a date.
- Bars are shifted by a day: Confirm whether duration is inclusive. For a one-day task, the start and finish should match when using
=B5+C5-1. If your duration definition excludes the start date, the calculation must follow that different convention. - Bars continue beyond the expected finish: Check that the finish-date formula uses the intended duration and that the conditional formatting refers to column D for the end date. A copied formula with a misplaced dollar sign can point to the wrong cell.
- Unexpected weekend dates: The simple addition formula counts every calendar day. Use WORKDAY or WORKDAY.INTL when the schedule is based on working days, and keep holiday dates in a real date range.
- Some dates do not compare correctly: A cell containing a date and time can behave differently from a date-only value when compared with a timeline date. Remove unintended time values or build the schedule consistently with date-only values.
Choosing a formula-based chart or another method
A formula-driven Gantt grid is useful when you want an editable schedule in the same workbook as task data. Changing a start date or duration recalculates the finish date, and conditional formatting updates the bar. It is also easy to print or share as part of a project worksheet. The trade-off is that the chart needs a sufficiently wide date grid, and more complex schedules can require additional columns for dependencies, owners, or progress.
A stacked bar chart is another Excel option. It can present a cleaner visual for a compact schedule, but it takes more chart setup and may need adjustment when tasks change. A conditional-formatting grid is often simpler for daily planning and lets readers see dates aligned directly with task rows. Neither approach automatically handles project dependencies unless you add formulas or another planning tool to represent them.
For a small project, start with dates and durations, then add only the information people need to make decisions. For a schedule with linked dependencies, resource limits, baselines, or frequent updates, a dedicated project-management application may be more suitable than maintaining a wide spreadsheet. Excel formulas calculate the dates you specify; they do not determine whether the plan is feasible.
Frequently Asked Questions
What is the Excel formula for a Gantt chart end date?
With the start date in B5 and an inclusive calendar-day duration in C5, use =B5+C5-1. For a five-day task beginning April 1, 2026, it returns April 5, 2026.
How do I make a Gantt chart in Excel without a template?
List tasks, start dates, durations, and finish dates; put consecutive dates across a header row; then apply conditional formatting to the task grid with a formula that checks whether each header date falls between that row’s start and finish.
Can Excel Gantt chart formulas skip weekends?
Yes. Use WORKDAY to calculate an end date after a specified number of working days, and provide a holiday range if needed. The basic addition formula counts weekends and holidays as calendar days.
Why does my Gantt chart show dates as numbers?
Excel stores dates as serial numbers. The value can still be a valid date even if it looks numeric; apply a date format to the cell or timeline range.
Can the Gantt bars update when I change a task date?
Yes. If the finish dates and conditional formatting refer to the task start and finish cells, editing a start date or duration recalculates the dates and updates the bar, provided the visible timeline covers the new schedule.
Related
- How to Move Freeze Panes in Excel to Different Rows
- How to Move Everything Down a Row in Excel Safely
- Move a Row Up or Down in Excel Without Losing Data
Try it: the Percentage Formula Generator: percent of, percent change, increase and decrease, with the formula.
More in Charts & pivot tables
- Power Pivot DAX: What It Does and How It Works in ExcelPower Pivot DAX is the formula language used to calculate and analyze data in Excel’s Data Model. DAX…
- Excel Line Chart With Multiple Series: A Step-by-Step GuideTo create a line chart with multiple series in Excel for Microsoft 365 on Windows, arrange each series…
- Excel Consolidate Pie Charts: Methods and LimitsTo consolidate data for a pie chart in Excel, combine the category totals into one summary table, select…
- Excel Pivot Table: Filter Out Zero ValuesTo filter zero values out of an Excel PivotTable, open the drop-down for the row or column field…
- Pivot Chart Not Showing All Data? How to Fix ItA PivotChart usually misses data because its PivotTable source has not been refreshed or expanded, or because a…
- Excel Chart Not Plotting Zero Values? How to Fix ItExcel normally plots numeric zero values, but a zero can be hard to see: a zero-height column has…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.