No add-ins, no chart objects — just shade the cells where each task is active. An AND formula rule across a date grid draws a clean, live Gantt chart that updates as your dates change.
The example
Three tasks across a week; shaded cells mark each task’s span.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Task | Mon | Tue | Wed |
| 2 | Design | |||
| 3 | Build | |||
| 4 | Test |
The formula
The single rule that builds the whole chart:
How it works
One formula, applied across a grid, draws every bar:
- Lay out date headers along row 1 (one column per day/week) and task start/end dates in columns B and C.
- Select the whole grid (the cells under the date headers), then add the rule
=AND(D$1 >= $B2, D$1 <= $C2). - The references are mixed:
D$1locks the header row (column floats),$B2/$C2lock the date columns (row floats). So each cell compares its own column-date to its own row-span. - Choose a fill color — that’s the bar. Drag a date and the bar moves; the chart is fully live.
Add a “today” line with a second rule: =D$1=TODAY() in a contrasting color marks the current date down the whole grid. Use TEXT in the headers to label weeks instead of days for longer projects.
Try it: interactive demo
Move a task’s start/end; the bar redraws.
Variations
Add a today marker
Second rule, contrasting color:
Percent-complete shade
Lighter bar past the % done:
Weekend columns
Dim non-working days:
Pitfalls & errors
Mixed references are critical. D$1 (row locked) and $B2/$C2 (column locked). Getting the $ placement wrong shades the whole grid or nothing.
Header dates must be real dates. Format them as dates (you can display just the day), or the >=/<= comparisons fail.
Active-cell alignment. Write the formula relative to the top-left cell of your selection, or the bars shift by a row/column.
Practice workbook
Frequently asked questions
How do I make a Gantt chart with conditional formatting in Excel?
Why are the wrong cells shaded?
How do I add a line for today?
Stop fighting formulas. Learn them in a day.
This recipe is one of hundreds of real-world formulas we teach. Our Excel Formulas & Functions class covers lookups, logic, text, and dynamic arrays hands-on — live in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.
See the Formulas & Functions Class