Perhaps I'm missing something from your explanation but could you not just use
COUNT(IF [Distance] < 5000 THEN 'whatever you want to count' END)
You can try below logic:
COUNT ( IF [distance] < 5000 THEN [distance] END )
No, its only about "COUNT". No "sum", no "avg", no "mean".
Im looking only for the super-easy option to count all entries from < 4000 to >1000.
"COUNT ( IF [distance] < 5000 THEN [distance] END )" gives an ERROR: "There is no option mix int & strings".
Could you please share your mock-up data.
I am assuming "Distance" is having string datatype.You can convert it into int and then use:
COUNT ( IF INT([distance]) < 5000 THEN [distance] END )