Dynamic component function problem

HELLO

how could I enter the ‘‘IF’’ function for example the following.

‘’ If the value of LENY is from 0 to 50 the result will be =1. From 50 to 100 the result will be=2. So successively from 50 to 50. stopping at 200, it cannot be greater than 200.

I managed in this function to give the result in a specific number, ex IT (LEN=30.1). What I don’t agree with is putting this value margin.

Thanks for the attention

Please share the file, it’s much easier to explain a problem.

= smallest(1+int(leny/51),4)

but as “Mike” says. a model would be best, to implement the code or show better way

nope, code fails for 101, 151

= smallest(1+int((leny-1)/50),4)