Hello!
I have a sheet that lists project milestones with a column for the milestone's due date and another column that I want to automatically assign the quarter that that due date falls in (Jan-Mar, Apr-Jun, Jul-Sep, Oct-Dec, and Q5 - which represents the "current" quarter but next year). Then there are projections columns for each quarter that pull in the payment amounts based on these designations.
It's working mostly correctly, but I had to make significant edits to it when it changed from September to October (a new quarter) because it suddenly assigned the same quarter to almost every milestone regardless of date, so I am worried the same will happen in future quarters, and especially when it becomes a new calendar year.
In addition to just generally checking that the formula is doing what I need it to do and will do so regardless of the current date... Here are my other specific problems:
- If the due date is in the past and in a past quarter (e.g. due 9/30/23, and it is now 10/5/23), and not marked complete yet, the quarter should read "PAST" so that the project manager can update the date. If the milestone due date is in the past, but still in the current quarter (e.g. if it was due 10/2/23 and it is now 10/5/23) I would like it to still be assigned the current quarter. Right now, it only says "PAST" if the date is in the past at all, regardless of quarter.
- The part that calculates Q5 is still having some trouble... Right now the only error I see in the sheet is that it assigned 8/30/24 as Q5 when it should just be Jul-Sep, and I can't figure out why. I am sure that part of the formula is a total mess though, I'm the one that created it and I can't really tell what it's doing.
(see screenshot below)
The calculation needs to incorporate whatever today's date/year is, mainly because of the need for Q5, which shifts every 3 months (it can't just say "if the date is between 7/1 and 9/30 then it's Jul-Sep" because if it's in those dates but next year then it needs to say Q5)... And it needs to somehow use the start/end dates of each quarter as boundaries to pinpoint where the due date falls.
This is the current column formula:
=IF(AND(ISDATE([Milestone Due Date]@row), [Milestone Complete?]@row = 0), IF([Milestone Due Date]@row < TODAY(), "PAST", IF([Milestone Due Date]@row <= (IF(TODAY() > DATE(YEAR(TODAY()), 9, 30), DATE(YEAR(TODAY() + 1), 9, 30), DATE(YEAR(TODAY()), 9, 30))), "Jul-Sep", IF([Milestone Due Date]@row <= (IF(TODAY() > DATE(YEAR(TODAY() - 1), 12, 31), DATE((YEAR(TODAY()) + 1), 12, 31), DATE(YEAR(TODAY()), 12, 31))), "Oct-Dec", IF([Milestone Due Date]@row <= (IF(TODAY() > DATE(YEAR(TODAY()), 3, 31), DATE((YEAR(TODAY()) + 1), 3, 31), DATE(YEAR(TODAY()), 3, 31))), "Jan-Mar", IF([Milestone Due Date]@row <= (IF(TODAY() > DATE(YEAR(TODAY()), 6, 30), DATE((YEAR(TODAY()) + 1), 6, 30), DATE(YEAR(TODAY()), 6, 30))), "Apr-Jun", IF([Milestone Due Date]@row <= (IF(AND((TODAY()) > DATE(YEAR(TODAY()), 3, 31), (TODAY()) < DATE(YEAR(TODAY()), 7, 1)), DATE((YEAR(TODAY()) + 1), 6, 30), IF(AND((TODAY()) > DATE(YEAR(TODAY()), 6, 30), (TODAY()) < DATE(YEAR(TODAY()), 10, 1)), DATE((YEAR(TODAY()) + 1), 9, 30), IF(AND((TODAY()) > DATE(YEAR(TODAY()), 9, 30), (TODAY()) <= DATE(YEAR(TODAY()), 12, 31)), DATE((YEAR(TODAY()) + 1), 12, 31), IF(AND((TODAY()) >= DATE(YEAR(TODAY()), 1, 1), (TODAY()) < DATE(YEAR(TODAY()), 4, 1)), DATE((YEAR(TODAY()) + 1), 3, 31)))))), "Q5", "")))))))
I am sure there is a glaring error in how I set this up, but I'm hoping it's straightforward enough to fix, since I have looked at it for way too many hours now and I am all out of ideas.
Thank you all in advance!