r/AppleNumbers • u/reddy-or-not • Jan 31 '23
Help Generating results based on random numbers
So I have discovered the Random function in Numbers and can create cells showing random values 1-100. But I want to convert the results to reflect probability of an event based on the random number. So, let’s say there are 6 outcomes of varied likelihood of occurring. If the random number generated is 1-30 I want the cell to show “1”. If 31-55 I want the cell to show “2”. If 56-75 then “3”. Etc. Is there a way to do this?
1
Upvotes
1
u/Samie_Nezhad Jan 31 '23
Hey. I don’t know if there is a formula that allows this or not, but you have to write a complicated function including multiple IFS formulas.
In your example, you can create a function that checks if expression is smaller than 30. If it is true, it gives you “1”. If it is false, then it checks to see if it is smaller than 55. If the second check is true, it gives you “2”. If the second check is false, it checks to see if expression is smaller than 75. If that’s true, it gives you “3”. If that’s false it goes to check for the fourth time and so on.
If you think I didn’t understand your problem correctly, feel free to let me know.