How to Conditional Format a Gantt Chart in 5 Easy Steps
A Gantt chart can look clear at first, then become hard to scan as deadlines move and tasks multiply. Manually changing bar colors takes time, and one missed update can make an overdue task look on track.
But here's the truth: conditional formatting can color the chart automatically when task dates match the timeline. You set a rule once, and the bars update as you change start or finish dates.
In this guide, I’ll show you how to conditional format a Gantt chart in five easy steps using an Excel-style grid. You’ll also learn how to highlight progress, milestones, weekends, and today’s date. The result is a chart that’s easier to update and quicker to read.
How to Conditional Format a Gantt Chart in 5 Steps
The basic setup uses a task list, start and finish dates, and a row of timeline dates. A conditional formatting formula checks whether each timeline date falls within a task’s schedule, then fills the matching cells.
Step 1: Set Up the Gantt Chart Grid
Arrange your columns so task details sit to the left of the calendar grid. For example, use this layout:
- Column A: task name
- Column B: start date
- Column C: finish date
- Row 4, starting in column D: timeline dates
- Rows 5–20: task details and chart cells
Make sure the dates are real date values, not text that only looks like a date. A timeline heading such as Apr 7 should represent an actual calendar date.
Step 2: Select the Timeline Cells
Select the empty chart area where the task bars should appear. In this example, select D5:AH20.
The selected range must align with the task rows and timeline dates. If your timeline starts in column E or your task list begins on row 6, adjust the range and formula references accordingly.
Step 3: Create a Formula-Based Formatting Rule
Open conditional formatting, choose the option to create a rule using a formula, and enter:
=AND(D$4>=$B5,D$4<=$C5)
This checks whether the date at the top of a chart column falls between the task’s start and finish dates. The dollar signs keep the references to the date row and task columns aligned as the rule moves across the selected range.
Here’s why: for the cell at D5, Excel checks the date in D4 against the start and finish dates in B5 and C5. As the rule applies to other cells, the timeline column and task row update automatically.
Step 4: Choose a Bar Color and Apply the Rule
Set a fill color for cells that match the formula, such as blue for scheduled work. Confirm the rule applies to the entire selected chart range, then save it.
Test the result by changing a task’s start or finish date. The colored cells should move with the schedule. If nothing changes, check that the cell references match your layout and that the dates are real dates.
Step 5: Add Useful Status and Calendar Rules
You can create more rules to make the chart easier to interpret. For example, use a different color for overdue work or completed tasks.
If column D contains the timeline date, column E contains task completion as a percentage, and column F contains the task status, a completed-task rule could be:
=AND(D$4>=$B5,D$4<=$C5,$F5="Complete")
Apply a distinct fill to that rule. You could also add rules for milestones or today’s date. Keep the colors meaningfully different, so a reader can tell planned work from progress at a glance.
Make the Formula Fit Your Gantt Chart
Conditional formatting depends on cell references. A formula that works in one layout may color the wrong cells in another, so check the starting cell before applying a rule.
For instance, if your timeline dates are in row 3, change D$4 to D$3. If task start and finish dates are in columns C and D, change $B5 and $C5 to match.
Check the “Applies To” Range
The formula’s first cell should match the upper-left cell of the selected range. If the range begins at E6, write the formula as though you are formatting E6.
A mismatched starting reference can shift the rule by one row or column. For example, selecting E6:AH20 but keeping D$4 in the formula could make the chart evaluate dates from the wrong column.
Decide Whether Finish Dates Are Inclusive
The example formula includes both the start date and finish date. That means a task scheduled from April 7 through April 9 displays a bar across all three dates.
If your finish date represents the first day after work ends, use a less-than comparison instead of less-than-or-equal. Choose one convention and use it consistently across the task list.
Show Progress, Milestones, and Today’s Date
Once the basic bars work, a few carefully chosen rules can answer practical questions: What is complete? Which tasks need attention? Where are we in the schedule?
The best part? You can add these details without manually recoloring every cell whenever the plan changes.
Distinguish Completed Work from Planned Work
Suppose task status is stored in column F. Add a second rule with the same date test and a status check, such as:
=AND(D$4>=$B5,D$4<=$C5,$F5="Complete")
Give completed tasks a different fill from active work. If you track progress as a percentage in column E, you can also use an additional rule for tasks at 100% completion.
For a more precise progress bar, the formula needs a progress date or a clear rule for how progress maps to calendar days. Without that, a percentage alone does not tell the chart which dates should appear complete.
Highlight Milestones
A milestone usually has one date rather than a multi-day span. If the milestone date is in column B, you can highlight its timeline cell with a rule such as =D$4=$B5.
Apply a distinct color or a bold border so the milestone stands apart from ordinary task bars. If tasks and milestones share the same row structure, make sure the milestone rule does not hide other important formatting.
Mark Today or Separate Weekends
To highlight today’s date, apply a rule to the timeline area using =D$4=TODAY(). A contrasting border can make the current position visible without obscuring task colors.
To shade weekends, use a formula such as =WEEKDAY(D$4,2)>5. A light background is usually enough. Strong weekend shading can compete with the task bars, especially when several colors already appear in the chart.
Keep the Gantt Chart Readable as Plans Change
A chart becomes less useful when every status has a different color or when old rules remain active. Start with a small visual system, then add a rule only when it answers a real planning question.
For example, a project team might use blue for scheduled tasks, green for completed work, and a red border for overdue tasks. Someone opening the chart can understand its main signals without a long explanation.
Use a Small, Consistent Color Palette
Give each color one meaning and keep that meaning consistent throughout the chart. If blue represents planned work in one section and completed work in another, readers have to stop and decode the display.
Consider color contrast as well. A pale fill with dark text is easier to read than a saturated bar behind small labels.
Review Rule Order and Overlap
Several rules may apply to the same cell. If an overdue rule and a completed-task rule both match, the final appearance may depend on rule order and whether a rule stops other rules.
Review the conditional formatting manager after adding rules. Put the most important exception where it can be seen, and remove duplicate rules that no longer serve a purpose.
Test the Chart with Realistic Changes
Try changing a start date, extending a finish date, and marking a task complete. These simple tests can expose broken references before the chart is used for a planning meeting.
A small test is especially useful when someone inserts a task row or adds new timeline dates. Confirm the formatting range expands to cover the new cells.
ONES.com Solution for Coordinating Project Work
Conditional formatting is useful when your Gantt chart lives in an Excel-style grid. When project coordination also involves changing workflows, sprint tracking, reporting, and shared project knowledge, ONES.com provides a broader project and knowledge management environment.

ONES.com is a unified platform powered by ONES Assistant. ONES Project handles project management and is a Jira alternative; ONES Wiki supports knowledge management and is a Confluence alternative. The products are sold separately, so you can choose the part that fits your team.
Core Capabilities
- Workflows need to match team processes: ONES Project supports custom workflows, helping teams reflect how tasks move through their work.
- Standard fields don’t capture enough detail: Custom fields let teams track project information that matters to their specific process.
- Sprint planning needs clearer coordination: Sprint management helps teams organize planned work around their development cycles.
- Project status takes too long to assemble: Built-in reporting gives teams a way to review project progress without relying only on manually updated chart colors.
- Repeated work creates avoidable overhead: Automation can handle supported routine actions, giving teams more time for planning and delivery.
- Teams want familiar Jira-style processes: Jira-compatible workflows can make it easier to adapt existing ways of working.
- Plugins complicate project setups: Native capabilities can reduce reliance on extra plugins for common project management needs.
- Hosting requirements restrict deployment choices: Teams can choose Cloud, On-Premise, Private Cloud, or Air-gapped deployment.
- Self-hosting raises feature concerns: ONES.com offers full feature parity between its cloud and self-hosted versions, so deployment choice does not require giving up feature access.
Application Scenarios
A software team could use ONES Project to manage sprint work, custom task fields, and reporting, while keeping a simple date-based Gantt view for stakeholders who prefer a calendar layout.
A team with strict hosting requirements could evaluate an On-Premise or Air-gapped deployment for project coordination. A smaller group can try the platform with up to 30 seats available for free.
ONES.com does not replace the formula steps in this guide. It can support the project workflow around them, especially when teams need more than a manually maintained schedule view.
Common Conditional Formatting Challenges
Most formatting problems come from a small set of causes: references point to the wrong cells, dates are stored as text, or rules overlap. Check the formula and range before rebuilding the chart.
The Bars Appear One Column Too Far to the Left
Problem: The rule begins with a different cell reference than the selected range’s first cell.
Solution: Check the upper-left cell of the range. If it is E6, base the formula on E6, not D5.
No Cells Change Color
Problem: The date headings may be text, or the formula may point to the wrong start and finish columns.
Solution: Confirm the headings are calendar dates and compare each formula reference with the grid layout. Test one task with a start and finish date you can verify easily.
Completed Tasks Keep the Planned Color
Problem: The completed-task rule may not apply to the chart range, or its status text may not match the task list.
Solution: Check the rule range and compare the status wording exactly. Review rule order if multiple rules target the same cells.
New Tasks Don’t Get Colored
Problem: The conditional formatting range may stop before the new task row.
Solution: Expand the “Applies To” range when you add rows, or structure the chart so the formatting range grows with your task list.
Frequently Asked Questions
Can I use conditional formatting to create Gantt bars in Excel?
Yes. Select the timeline cells and use a formula that checks whether each column’s date falls between the task’s start and finish dates. For example, if dates sit in row 4 and task dates are in columns B and C, use =AND(D$4>=$B5,D$4<=$C5). Apply a fill color to matching cells. Adjust references if your layout differs.
Why does my Gantt chart formula use dollar signs?
Dollar signs lock part of a cell reference when the formatting rule moves. In D$4, the row stays fixed while the column changes across the timeline. In $B5, the column stays fixed while the row changes for each task. This mixed-reference setup lets one rule evaluate every chart cell against the correct date and task.
How do I show weekends in a different color?
Apply a conditional formatting rule to the timeline area using =WEEKDAY(D$4,2)>5. With the second argument set to 2, weekdays run from Monday through Sunday, making 6 and 7 the weekend. Choose a light fill so the weekend shading remains visible without overpowering the task bars.
Can conditional formatting show task progress?
It can, but a completion percentage alone does not identify which days should appear complete. You need a clear relationship between progress and the timeline, such as a progress-through date or a defined number of completed days. Once that relationship is available, you can add a rule to distinguish completed portions from remaining work.
Conclusion: Make Your Project Schedule Easier to Read
To build an automatically colored Gantt chart, set up task dates and timeline headings, select the chart cells, and apply a formula-based rule. Then test the references and add only the status or calendar highlights your team needs.
That small setup can save you from manually moving bars whenever a schedule changes. If your planning needs grow beyond a date grid, consider how project workflows, reporting, and deployment requirements fit together. A clear Gantt chart starts with reliable dates—and stays useful when its rules are easy to understand.