I am creating a timeline to be used by co-workers who are not very savvy with Excel. They wanted the Planned Start/End Dates to be calculated based off of one date that they enter, along with durations that they can edit. They do NOT want to edit the actual Planned Dates.
It is crucial that they are able to add/delete rows within the table I've created. However, every time I attempt to test that, the formulas I've entered to calculate the Planned Start/End Dates break.
I have tried entering the formulas directly into the table, and I have also tried entering the formulas alongside the table (but not within it) and referencing those cells to populate the dates.
I have also tried referencing the column's actual names instead of column letters.
Explanation of what each cell represents:
D7: Whether to calculate the dates based on Project Start Date or In Warehouse Date
D8: Specified date
Column E: Duration (Days)
Column F: Planned Start
Column G: Planned End
Planned Start Date Formula (very first row):
=IF($D$8="","",IF($D$7="Project Start Date",$D$8,IF($D$7="In Warehouse Date",G11-E11+1,"")))
Planned Start Date Formula (all rows after first row):
=IF($D$8="","",IF($D$7="Project Start Date",F11+E11,IF($D$7="In Warehouse Date",G12-E12+1,"")))
Planned End Date Formula (very last row):
=IF($D$8="","",IF($D$7="Project Start Date",F35+E35-1,IF($D$7="In Warehouse Date",$D$8,"")))
Planned End Date Formula (all rows before last row):
=IF($D$8="","",IF($D$7="Project Start Date",F34+E34-1,IF($D$7="In Warehouse Date",G35-E35,"")))
The formulas calculate the dates correctly. However, they break whenever I add or delete rows. When adding rows, it pushes the Duration reference so that it's always off by one row after the added row. When deleting rows, it completely breaks the formula and replaces the Duration reference with #REF.
I am somewhat familiar with VBA, so if I am able to somehow fix this issue using a Macro or VBA code, I'd be more than happy to try it.
Thank you!