Any idea what is the best way execute the following function, so the range between 0-1023 in analog input

should be divided by 30 and if the analog input value is between 0 - 34.1 so the parameter value is 1 and

if the analog input value is between 34.1 - 68.2 so the parameter values is 2 and so on…

I know that I’m able to do that with following function:

value = analogRead(iPotentiometer);

if (value < 34.1 && value > 0)

value2 = 1;

if (value < 68.2 && value > 34.1)

value2 = 2;

.

.

.

if (value < 1023 && value > 988.9)

value2 = 30;

…but this take a lot of space, any shortest possibilities ?