For example if the “actual submission date” = “Expected submission date” then i would like the status column to say “On time”
if the “actual submission date” > “Expected submission date” then i would like the status column to say “Early”.
in this formula is there anyway i can add a time limit for “unsatisfactory” rating. That if Submission date has been exceeded by 14 days, it should fall under unsatisfactory.
for “below Expectation” the Submission Date should should be below extension of 14 days
Below is the formula Used:
SwitchIf(
IsBlank(thisRow.[Expected date]) AND IsBlank(thisRow.[Submission Date]),
“Enter dates”,
(thisRow.[Expected date]) AND IsBlank(thisRow.[Submission Date]),
“Unsatisfactory”,
thisRow.[Submission Date] = thisRow.[Expected date],
“Meets Expectations”,
thisRow.[Expected date] < thisRow.[Submission Date],
“Below Expectations”,
thisRow.[Expected date] > thisRow.[Submission Date],
“Exceeds Expectations”
)
I have used thisRow.[Expected Date]-thisRow.[Submission Date] <= -14 as the formula. This gets you the date difference in days and checks if it is less than or equal to -14. If the Submission happens before the Expected date the number is positive and if it is after the number is negative. You can try this by adding a column that has a formula of just thisRow.[Expected Date]-thisRow.[Submission Date] to see what it returns for each row.
Now one very important thing to understand about SwitchIF, and why I have put the new argument in the middle rather than at the end, is that SwitchIF will stop at the first test that returns TRUE.
Prior to the modification it was fine as only one possible test could be correct (return TRUE). Now when a Submission is exceeded by 14 days, both the new 14 day test and the old test of thisRow.[Expected Date] < thisRow.[Submission Date] could return TRUE and it will stop at the first one it finds. If I placed the new test at the end it would never show as it would always stop when the Expected Date is before the Submission Date test and return “Below Expectations”.
Note that if you are going to add further arguments with different day values it will add more complexity. If you are not getting the result you expect the order is likely wrong.
I hope that this makes sense and can help you out.