ARANDBETWEEN

ARANDBETWEEN(va,vb,[r],[c],[uq],[fm])
va
real number
vb
real number (order not important, va can be > vb)
[r]
rows of result array ; if omitted r=1
[c]
columns of result array; if omitted c=1
[uq]
unique argument, if omitted, results can have duplicates, if 1, no duplicates (only unique values)
[fm]
format argument; if omitted, no format; not omitted => TEXT(result array, fm)

Random Numbers. Functions. Nonrandomness of random numbers.

Xlambda

Well-known Member
Joined
Mar 8, 2021
Messages
837
Office Version
  1. 365
Platform
  1. Windows
ARANDBETWEEN Returns an array of random integers between 2 numbers, with or without duplicates.
Excel Formula:
=LAMBDA(va, vb, [r], [c], [uq], [fm],
    LET(
        w, MAX(1, r),
        l, MAX(1, c),
        n, w * l,
        x, FLOOR(MAX(va, vb), 1),
        m, CEILING(MIN(va, vb), 1),
        k, x - m + 1,
        s, SEQUENCE(k, , m),
        IF(
            AND(uq, k < n),
            NA(),
            LET(y, IF(uq, SORTBY(s, RANDARRAY(k)), RANDARRAY(n, , m, x, 1)), z, INDEX(y, SEQUENCE(w, l)), IF(fm = "", z, TEXT(z, fm)))
        )
    )
)
 
Upvote 0
Whoa!!!!! That is spectacular.

=LAMBDA(n,m,
LET(
z, INDEX(m, 3, ),
x, INDEX(m, 1, ) - NOT(z),
ROUNDUP(RANDARRAY(n, COLUMNS(m)) * (INDEX(m, 2, ) - x) + x, z)
)
)(V13,V14:X16)

And I got my 10 row 3 column rand table : ) : ) : )

Excel Lambda : ) : ) : ) !!!!!
 
Whoa!!!!! That is spectacular.

=LAMBDA(n,m,
LET(
z, INDEX(m, 3, ),
x, INDEX(m, 1, ) - NOT(z),
ROUNDUP(RANDARRAY(n, COLUMNS(m)) * (INDEX(m, 2, ) - x) + x, z)
)
)(V13,V14:X16)

And I got my 10 row 3 column rand table : ) : ) : )

Excel Lambda : ) : ) : ) !!!!!
 
FREEZE is wild too - with that checked Tools, Formula, Enable iterative calcs : ) : )
 

Forum statistics

Threads
1,216,499
Messages
6,131,012
Members
449,613
Latest member
MedDash99

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