Add Task Labels to an Excel Conditional Formatting Gantt Chart
Question details
Display task names inside the date cells of a conditionally formatted Excel Gantt chart without VBA.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A user has a Gantt chart built with conditional formatting and wants each active date cell to show its task name.
- Observed behavior
- The desired result is a timeline whose active date cells display task names along with the existing Gantt formatting.
Identify the task name, start date, end date, and timeline header cells in your worksheet. The example below assumes task names are in column B, start dates in column C, end dates in column D, and the first timeline date in BA5.
Use a formula to show task names in active Gantt cells
Enter a formula in the timeline grid to return the task name whenever a date overlaps the task period.
Select BA7, the first timeline cell for the first task, and enter =IF(AND($D7>=BA$5,$C7<BA$5+1),$B7,""). Adjust the cell references to match your worksheet.
Drag the fill handle from BA7 across the date columns and down the task rows, or select the target range and use Home > Fill.
Select the timeline grid and open Home > Conditional Formatting > Manage Rules. Confirm that the Gantt rule still applies to the full grid and uses the appropriate date and task references.
Use Home > Wrap Text or adjust the timeline column widths if task names do not fit inside the date cells.

Add Gantt Task Labels in WPS Spreadsheet
Use a formula in WPS Spreadsheet to display task names in active timeline cells, then check the conditional formatting on the Gantt grid.
- 1. Open the workbook: Open WPS Spreadsheet and select Open to load your Excel Gantt chart workbook.
- 2. Add the formula: Select the first task timeline cell and enter =IF(AND($D7>=BA$5,$C7<BA$5+1),$B7,"") for the example layout. Change the references to match your sheet.
- 3. Fill the grid: Drag the cell's fill handle across the timeline and down through the task rows.
- 4. Review formatting and save: Select the timeline and check its rules under Home > Conditional Formatting. Use File > Save As to save the workbook in XLSX format.

Frequently Asked Questions
Do I need VBA to show task names in Gantt cells?
No. Enter an IF formula in the first timeline cell that returns the task name when the timeline date falls within the task period, then fill it across and down.
What if my task names are not in column B?
Replace $B7 in the formula with the task name cell for the first row, such as $A7 for column A. Keep the dollar sign before the column letter when filling across.
Why do some task labels appear cut off?
The task name may be wider than the timeline cell. Select the cells and use Home > Wrap Text, or widen the date columns.
Will the existing Gantt colors still work after I add formulas?
That depends on how the conditional formatting rule is written. Select the timeline and check Home > Conditional Formatting > Manage Rules to verify the rule and its applied range.




