rotary encoder

hi,

i have a rotary encoder wired up and i was wondering if it is possible to do this a short way or do i need to make an IF section for every 5 value of the rotary_counter

rotary_counter == (every 5)

or

if (rotary_counter ==1)
//do this

else if (rotary_counter == 5)
//do the same thing

else if (rotary_counter == 10)
//do the same thing

https://www.arduino.cc/reference/en/language/structure/arithmetic-operators/modulo/

Pieter