Random List of Numbers

andrewwglenn

New Member
Joined
Sep 3, 2013
Messages
10
I am trying to generate a sequence of incremented integers where some are known and some are populated randomly within a sequence construct. For example:

#<10<#<#<20<#<#<30<<<100 <#<#<1010, etc.

The idea is that each of the "#" is replaced with a unique integer that is greater than the previous and less than the next (whether the next is random or known).

The problem I encounter is tackling the 2nd consecutive random integer (shown above in bold). I haven't figured out how to guarantee that the integer is greater than the value directly preceding it. Is this possible without VBA or looping?

Ultimately, my goal is to be able to randomly generate an incremented list within these constraints as often as necessary.

Thanks.


Andrew
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
VBA would be neater. You'll need some helper cells using a formula approach.

Here's one way you could do it:

C2: =B2+MATCH(RANDBETWEEN(1,COMBIN($F2-B2-1,COLUMNS(C2:$F2)-1)),C4:C20) Copy across to D2:E2
C4: =1
C5: =COMBIN($F$2-B$2-1-ROWS(C$5:C5),COLUMNS(C$2:$F$2)-2)+C4 Copy down and across


Excel 2010
ABCDEF
1AnchorAnchor
21014171820
3
4111
52952
65083
76510#NUM!
87511#NUM!
981#NUM!#NUM!
1084#NUM!#NUM!
1185#NUM!#NUM!
12#NUM!#NUM!#NUM!
13#NUM!#NUM!#NUM!
14#NUM!#NUM!#NUM!
15#NUM!#NUM!#NUM!
Sheet1
 
Upvote 0

Forum statistics

Threads
1,223,164
Messages
6,170,444
Members
452,326
Latest member
johnshaji

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