Currently I'm using 2 helper columns to calculate the start and end dates of a month and using those to search through another sheets "Completed Date" to find the number of tasks that were completed in that month. However, right now my formula is only returning zero.
Below is my helper columns. Start-10 is the first day of the month 10 months in the past. End-10 is the last day of the month 10 months in the past.
Start-10 Formula:
=DATE(YEAR(TODAY()) - IF(MONTH(TODAY()) <= 10, 1, 0), IF(MONTH(TODAY()) - 10 <= 0, MONTH(TODAY()) - 10 + 12, MONTH(TODAY()) - 10), 1)
End-10 Formula:
=IF(MONTH(TODAY()) - 9 <= 0, DATE(YEAR(TODAY()) - 1, MONTH(TODAY()) - 9 + 12, 1), DATE(YEAR(TODAY()), MONTH(TODAY()) - 9, 1)) - 1
These are returning the dates that I need but I'm not sure they are actually considered dates which could be part of the problem.
My final formula is using these dates to search another sheet "Completion Date". It should count the number of tasks completed between these two dates. Ideally I need it to also find the status column of that row and count "On Time" vs "Late" but I haven't even been able to get the more simplified version of this formula to work. Currently I'm not getting any syntax errors but it's only returning zero.
Formula:
range 2 being "Completed Date" and range 4 being "Status"
=IF(COUNTIFS({Task Completion History Range 2}, ">=" + TODAY(-10), {Task Completion History Range 2}, "<=" + TODAY(), {Task Completion History Range 4}, <>"", {Task Completion History Range 4}, <>"No Data") = 0, 0, COUNTIFS({Task Completion History Range 2}, ">=" + TODAY(-10), {Task Completion History Range 2}, "<=" + TODAY(), {Task Completion History Range 4}, "On Time") / COUNTIFS({Task Completion History Range 2}, ">=" + TODAY(-10), {Task Completion History Range 2}, "<=" + TODAY(), {Task Completion History Range 4}, <>"", {Task Completion History Range 4}, <>"No Data"))