How about you divide the number with 5 and then check the range?
Example:
12 / 5 = 2.4 (rounded to 4) ; now you check if the result (4) is higher or less than 5
This however can be tricky and maybe a little ineffective as you have more ranges and need to check them all..
Maybe first you should check if it is lower than 5, if it is not check if it is lower than 10 and if it is set the number to 10, and so on...