Try this....apologies for any syntax errors, I wasn't able to open attached due to version differences.
Create a field called [Condition] with the formula:
IF [Distance] >= 8 AND [Distance] <= 20 THEN 1 END
Then a 2nd field:
WINDOW_SUM (SUM([Number of Records])
You should be able to add this 2nd field to "Detail" and then include it in a title.