Minecraft wiki entry for Target_selectors, associated text: Examples in Bedrock Edition:
@e[rm=9,r=10] — Target all entities exactly ten blocks away.
@e[rm=7,r=16] — Target all entities from 8 to 16 blocks away.