I hope there is a simple solution to fix my LONG running calculation. It works, but when running against 125k+ rows it takes forever. What I'm basically trying to do is compare the CURRENT row
=IF(COUNTIFS($A:$A,[FIN], $P:$P, ">"&[Base_Time],$P:$P,"<="&[Target_Time1])>=1,"Excellent",IF(COUNTIFS($A:$A,[FIN], $P:$P, ">"&[Base_Time],$P:$P,">"&[Target_Time1],$P:$P,"<="&[Target_Time2])>=1,"Good",IF(COUNTIFS($A:$A,[FIN], $P:$P, ">"&[Base_Time],$P:$P,">"&[Target_Time2])>=1,"Fair","Poor")))
What I'm basically trying to do is compare the CURRENT row with other matching [FIN] rows in the table and based on the time range return to the column either "Excellent, Good, Fair, Poor" . Each row is a patient assessment which requires a follow up. If the follow up was within an hour of the current row then return "Excellent"... within 2 hours then "Good"....greater than 2 hours "Fair... no other row older than the current row then "Poor"
Would it speed things if I just calculated the target times in the formula instead of looking at the column value? (Target_Time1=[Base_Time]+1/24)
FIN - is the visit ID (Column A)
Base Time - is the event date/time (Column P)
Target_Time1 - is the upper time limit for the excellent category (within 1 hour) (Column R)
Target_Time2 - is the upper time limit for the Good category (within 2 hours) (Column S)
Target_Time3 - is the upper time limit for the Fair category (Column T)
POOR is everything else
I appreciate any help/advice you can provide! and if there is a better way to structure the data, then I'm open to that advice as well.
Thanks you in advance for your assistance
Bookmarks