Results 1 to 12 of 12

RANDBETWEEN - maybe not so random

Threaded View

  1. #9
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: RANDBETWEEN - maybe not so random

    Odds of 1 or more duplicates in 10000 rows : 66.52 %
    (The loop calcs the probability of 10000 uniques, which is then subtracted from 1.)
    Sub CalcOdds()
        Dim M As Double, i As Double, k As Double
        M = 26 ^ 4 * 10 ^ 2
        k = 1
        For i = 0 To 9999
        k = k * (1 - i / M)
        Next
        MsgBox "Odds of 1 or more duplicates in 10000 rows: " & Format(100 * (1 - k), "0.00") & "%"
    End Sub
    Last edited by leelnich; 02-28-2018 at 07:10 PM.
    Clicking the Add Reputation star below helpful posts is a great way to show your appreciation.
    Please mark your threads as SOLVED upon conclusion (Thread Tools above Post # 1). - Lee

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Assign random number (RANDBETWEEN) equal number of times
    By dechesne in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-20-2016, 10:58 AM
  2. Replies: 10
    Last Post: 07-03-2015, 04:29 PM
  3. HELP: How to get random data from a 'table' using 'randbetween'
    By faizzsheikh in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-17-2015, 08:03 PM
  4. Randbetween or Random Number (1,3)
    By itselflearn in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-27-2013, 02:34 PM
  5. Replies: 8
    Last Post: 09-21-2011, 06:50 PM
  6. [SOLVED] Re: Non-random numbers generated by excel's data analysis random gener
    By Harlan Grove in forum Excel General
    Replies: 2
    Last Post: 09-13-2005, 12:05 PM
  7. Random numbers not using randbetween()
    By davehill1974 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-07-2005, 12:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1