Well, you didn't say "within a year". It is counting occurrences of that patient ID, less 1, assuming the first visit doesn't count. Hence, is the helper column >= 4?it doesn't seem to limit to counting 4 or more follow ups within a year though?
Unless you repeat the referral date in each patient record, I don't see how you will be able to produce the figure that you are looking for. If you do, you might be able to use a COUNTIFS function to calculate how many entries are within a given timeframe, for example, referral date + 365.
The separate elements of the formula would create a matrix of TRUE or FALSE entries. The -- coerces those boolean values int 1s and 0s which can then be multiplied together and added up.
Regards, TMS
Bookmarks