specify gap size using Randbetween function

White Top

New Member
Joined
May 1, 2019
Messages
2
How can RANDBETWEEN(1,850) be modified to select numbers <+8 or >-8 of the previous selection?
Thanks, White Top
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
a​
b​
2​
254​
a2: =randbetween(1, 850)
3​
249​
a3: =randbetween(max(1, a2 - 8), min(a2 + 8, 850))
4​
249​
5​
253​
6​
252​
7​
252​
8​
260​
9​
266​
10​
266​
11​
271​
12​
272​
13​
268​
14​
273​
15​
271​
16​
267​
17​
268​
 
Upvote 0
a​
b​
2​
254​
a2: =randbetween(1, 850)
3​
249​
a3: =randbetween(max(1, a2 - 8), min(a2 + 8, 850))
4​
249​
5​
253​
6​
252​
7​
252​
8​
260​
9​
266​
10​
266​
11​
271​
12​
272​
13​
268​
14​
273​
15​
271​
16​
267​
17​
268​

<tbody>
</tbody>
Excellent! Thank you, works like a charm! One more very useful bit for my toolkit. Many thanks.
 
Upvote 0

Forum statistics

Threads
1,213,561
Messages
6,114,315
Members
448,564
Latest member
ED38

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top