I'm not exactly sure how to write it, but you might be able to use an indicator function. It could be set up as a binary that would multiply any values less than 5 by zero, so they aren't counted, and any values over 5 by one, so they are included. If you Google around, you might be able to find an example. I can't find one right now.
Do you mind me asking what the broader context of this question is?