Hi,
I'm very new to using access VBA and functions etc so please bear in mind I may need things explaining very simply.
I have a variable called "Output random number" which has values from 0 to 1000. I need to group these into 20 bucket as such
0 -49 =1
50 -99 = 2
100 -149 =3
.
.
.
950 -1000 =20
I cant do this in an access query as it find it too complex to have so many nested if statements
I believe I should be able to create a function to do this but I do not know how to do this.
Please could anyone help?
I'm very new to using access VBA and functions etc so please bear in mind I may need things explaining very simply.

I have a variable called "Output random number" which has values from 0 to 1000. I need to group these into 20 bucket as such
0 -49 =1
50 -99 = 2
100 -149 =3
.
.
.
950 -1000 =20
I cant do this in an access query as it find it too complex to have so many nested if statements
I believe I should be able to create a function to do this but I do not know how to do this.
Please could anyone help?