# How to Select Randomly between a range of numbers

This topic is 1869 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!

##### 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
• 2
##### Share on other sites

Thanks! That worked.

##### Share on other sites

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

## Create an account

Register a new account