We have this formula in the [Task Status] column of every one of our 82 production sheets (as a column formula). See the attached .txt file for a pretty printed version of the formula.
=IF([DTM?]@row,
IF(
OR(
ISBLANK([Start Date]@row),
ISBLANK([End Date]@row),
NOT(ISDATE([Start Date]@row)),
NOT(ISDATE([End Date]@row)),
IF([TM?]@row,
FALSE,
OR(
AND(
COUNTIFS(CHILDREN([DTM?]@row), @cell = 1, CHILDREN([Task Status]@row), @cell <> "Unscheduled") > 0,
COUNTIFS(CHILDREN([DTM?]@row), @cell = 1, CHILDREN([Task Status]@row), @cell <> "Unscheduled", CHILDREN(Complete@row), @cell < 1) = 0,
COUNTIFS(CHILDREN([DTM?]@row), @cell = 1, CHILDREN([Task Status]@row), @cell = "Unscheduled") > 0),
COUNTIFS(CHILDREN([DTM?]@row), @cell = 1, CHILDREN([Task Status]@row), @cell <> "Unscheduled") = 0))),
"Unscheduled",
IF(Complete@row = 1,
IF(IF(ISBLANK([Date Completed]@row), Today#, DATEONLY([Date Completed]@row)) < DATEONLY([End Date]@row),
"Completed Early",
IF(IF(ISBLANK([Date Completed]@row), Today#, DATEONLY([Date Completed]@row)) > DATEONLY([End Date]@row),
"Completed Late",
IF(IF(ISBLANK([Date Completed]@row), ([End Date]@row), DATEONLY([Date Completed]@row)) = Today#,
"Completed Today",
IF(IF(ISBLANK([Date Completed]@row), DATEONLY([End Date]@row), DATEONLY([Date Completed]@row)) > (Today# - 7),
"Completed Recently",
"Completed")))),
IF(Today# > DATEONLY([End Date]@row),
"Overdue",
IF(Complete@row = 0,
IF(Today# < DATEONLY([Start Date]@row),
"Not Due To Start",
"Not Yet Started"),
IF(Today# < DATEONLY([Start Date]@row),
"In Progress Early",
"In Progress"))))),
"")
The blank lines in the formula are unintentional and cropped up when I was pasting. Can't get rid of them. Plus the indentation in the code seems to get lost - see the attachment. Sorry.
From midday 14-May-2025 until late 16-May-2025, the value of [Task Status]390 in a particular sheet changed from "Completed Today" to "Overdue" and then back to "Completed Recently" and then back to "Overdue" and then back to "Completed Recently" (as shown by Cell History).
During this same period, the value of [Complete]390 remained at "1" (as shown by Cell History).
During this same period, the value of [End Date]390 remained at "14/5/25" (as shown by Cell History) - being 14-May-2025.
This situation cropped up when seeking to understand why Today# (which we set to the current date at 1am every morning in every sheet) wasn't being updated by our API.
Our regression test sheet of [Task Status] has been in place for many years. It deems this formula to meet our specification for the 11 status outcomes.
There has been no change to this formula for over two years.
I am completely stumped as to how this formula can EVER return "Overdue" when [Complete]@row is "1" (i.e. the task is 100% complete).
Any ideas, no matter how wild, will be appreciated.