Jump to content
Server Maintenance This Week. ×

How to Select Randomly between a range of numbers


This topic is 2867 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I have 20 fields, and I want to select one to highlight in a random manner.  (I'm trying to build a "wheel" of sorts to select a number of points to play a game). This will return up to a two digit number: Int ( random * 100) However, there are a lot of numbers greater than 20. How can I pick just between 1 - 20? Would it be easier to have 20 records versus 20 fields?

 

Many thanks for any great ideas!

Link to comment
Share on other sites

30 minutes ago, Maclurv said:

How can I pick just between 1 - 20?

To select a random number between 1 and 20 (inclusive), use =

Int ( Random * 20 ) + 1

 

30 minutes ago, Maclurv said:

Would it be easier to have 20 records versus 20 fields?

Very likely so. Hard to be sure without knowing the purpose (what happens after the selection).

 

Edited by comment
  • Like 2
Link to comment
Share on other sites

This topic is 2867 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.