Most spreadsheet Gantt charts are coloured cells someone fills in by hand. As soon as one task slips, the whole thing is out of date. This tutorial builds one that schedules itself. You enter durations and dependencies, and the formulas work out the dates, skip weekends and holidays, and draw the bars. No macros, no chart objects, and it works in Excel 365/2021 and Google Sheets.

1. Two settings: your working week and your holidays

Make a small settings area (another sheet is fine) and create two named ranges (Formulas → Name Manager in Excel, Data → Named ranges in Sheets):

Name Example value Meaning
Weekend 0000011 7 characters, Monday to Sunday. 1 = day off.
Holidays a column of dates Days nobody works

The 7-character string is the trick here. WORKDAY.INTL and NETWORKDAYS.INTL accept it directly, so a team that works Sunday to Thursday just types 0000110. You don't need to change any formula.

2. The task table

Set up columns A to K on a sheet called Tasks, with headers in row 1:

A B C D E F G H I J K
1 ID Task Fixed start Depends on Days Start End % done Done through Plan % Status
2 T1 Kickoff workshop 2027-01-04 1 100%
3 T2 Wireframes T1 5 60%
4 T3 Visual design T2 8 0%
5 T4 Build T3 10 0%
6 T5 Client review T4 0 0%

You type into A to E and H. Everything else is a formula. Days means working days, and 0 marks a milestone.

Start (F2)

=IF(D2="", WORKDAY.INTL(C2-1, 1, Weekend, Holidays), WORKDAY.INTL(XLOOKUP(D2, $A$2:$A$300, $G$2:$G$300), 1, Weekend, Holidays)) 
  • With no dependency, WORKDAY.INTL(C2-1, 1, ...) "snaps" the fixed start to a working day. If C2 already is a working day you get C2 back. If it falls on a Saturday you get Monday.
  • With a dependency, the task starts on the first working day after the predecessor's end date.

No XLOOKUP in your version? Use INDEX($G$2:$G$300, MATCH(D2, $A$2:$A$300, 0)) instead.

End (G2)

=IF(E2=0, F2, WORKDAY.INTL(F2, E2-1, Weekend, Holidays)) 

The -1 is because the start day counts as day one. A 1-day task starts and ends on the same date. A milestone (0 days) is a single point.

Fill F2:G2 down. Now change T2 from 5 days to 7 and watch T3, T4 and T5 all move. Holidays push them too.

Watch for loops. If T3 depends on T4 and T4 depends on T3, you get a circular reference. That is a real planning error, so the warning is useful.

Done through (I2)

This is the last date covered by the completed part of the bar:

=IF(ROUND(E2*H2, 0) = 0, F2-1, WORKDAY.INTL(F2, ROUND(E2*H2, 0) - 1, Weekend, Holidays)) 

When nothing is done, it returns the day before the start, so no cell in the grid will match.

Plan % (J2) and Status (K2)

Plan % is how far along the task should be today, counted in working days:

=IF(E2=0, --(TODAY()>=F2), IF(TODAY()<F2, 0, MIN(1, NETWORKDAYS.INTL(F2, TODAY(), Weekend, Holidays) / E2))) 

Then a plain-English status:

=IF(H2>=1, "Done", IF(TODAY()>G2, "Overdue", IF(TODAY()<F2, "Upcoming", IF(H2 < J2-0.1, "Behind", "On track")))) 

The 0.1 is a tolerance, so a task that is 2% behind doesn't turn red. Format J as a percentage.

3. The timeline header

Leave column L empty as a spacer. In M1, start the grid on the Monday of the week the project starts:

=MIN($F$2:$F$300) - WEEKDAY(MIN($F$2:$F$300), 3) 

WEEKDAY(date, 3) returns 0 for Monday through 6 for Sunday, so subtracting it always lands on a Monday.

In N1 put =M1+1 and fill right for as many days as you need (182 columns gives 26 weeks). Then:

  • Give M1 onward the custom number format d so each header shows just the day number.
  • Set the column width to about 2.5 (Excel) or 22 px (Sheets).
  • Optionally rotate the header text or add a row above with format mmm for month labels.

4. Drawing the bars with conditional formatting

Select the grid body, e.g. M2:GL300, and add these rules as "Use a formula to determine which cells to format". Write them for the top-left cell (M2). The mixed references (M$1, $F2) let each rule work across the whole range.

Order matters. In Excel the rule at the top wins when two set the same fill. In Google Sheets the first matching rule wins. Add them in this order:

  1. Non-working day (light grey):
 =OR(MID(Weekend, WEEKDAY(M$1, 2), 1) = "1", COUNTIF(Holidays, M$1) > 0) 

WEEKDAY(..., 2) returns 1 for Monday, which matches position 1 of the Weekend string. One rule handles any working week.

  1. Milestone (gold):
 =AND($E2 = 0, M$1 = $F2) 
  1. Completed portion (dark/solid):
 =AND(M$1 >= $F2, M$1 <= $I2) 
  1. Overdue (red):
 =AND(M$1 >= $F2, M$1 <= $G2, $G2 < TODAY(), $H2 < 1) 
  1. Planned work (light brand colour):
 =AND(M$1 >= $F2, M$1 <= $G2) 

Add one more rule on the header row only (M1:GL1) to mark today: =M1=TODAY() with bold text and a bright fill.

Because rule 1 comes first, weekends inside a bar stay grey. You can see at a glance that a "5-day" task actually spans 7 calendar days.

If your spreadsheet app rejects named ranges inside conditional formatting (Google Sheets may), replace Weekend and Holidays in rule 1 with absolute references such as Settings!$B$1 and Settings!$B$4:$B$40. In Sheets you may need to wrap cross-sheet references in INDIRECT("Settings!B1").

5. Small touches that make it usable

  • Freeze panes at M2 so task names and dates stay visible while you scroll the timeline.
  • Data validation on column D: a list from $A$2:$A$300, so dependencies can't be mistyped.
  • Data validation on H: decimal between 0 and 1.
  • Sort or filter by Status to get an instant "what's late" view.
  • Keep the table at 300 rows even if you only use 20. Empty rows just render as blank grid. Wrap F, G, I, J and K in IF($E2="", "", ...) so they don't show errors.

What you have now

A plan where you only type durations, dependencies and progress. Dates follow your real working calendar, slips ripple downstream automatically, and the grid colours itself: done, planned, overdue, milestone, days off. It's around a dozen formulas and five formatting rules, and you can copy all of it from this post.

If you want the bigger version

I took this same approach much further in a workbook I sell called Gantt Pilot. It adds multiple projects with a project filter and hide-done switch, a week-offset scroller, a dashboard with weighted % complete against plan and RAG status per project, a needs-attention list, and an owner-by-week workload heatmap. It works in Excel and Google Sheets, with no macros. It's on Gumroad: https://khalidmasscom.gumroad.com/l/gwpic

Disclosure: I run the store that sells Gantt Pilot. Everything in this tutorial works on its own without it.