Re: VLOOKUP and RAND question

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: JE McGimpsey (jemcgimpsey_at_mvps.org)
Date: 03/07/04


Date: Sun, 07 Mar 2004 10:53:52 -0700

As long as your numbers in column 2 are mapped 1 to 1 with numbers in
column 1 (e.g., no duplicates in column 1 with differing numbers in
column 2), you can use:

    =INDEX(B:B,RAND()*COUNTA(B:B)+1)

In article <deacs.12re4f@excelforum-nospam.com>,
 deacs <<deacs.12re4f@excelforum-nospam.com>> wrote:

> Hi,
>
> I have a question regarding the VLOOKUP, RAND, and maybe IF functions
> in Excel. I would greatly appreciate it if anyone can help with my
> problem. I have 2 columns of data and would like to use a formula for
> Column 3.
>
> Column 1 = numbers 1, 2, 3
> Column 2 = numbers 500, 1000, 1500 associated with Column 1
>
> I would like Column 3 to use the RAND function to randomnly pick from
> the numbers in Column 1, then return the value in Column 2. I'm not
> sure how to do this.
>
> Since there is equal probability of the numbers in Column 1 to appear,
> can I just use the RAND function for Column 2 and skip the first step I
> mentioned?
>
> Thanks in advance!
>
>
> ---
> Message posted from http://www.ExcelForum.com/
>



Relevant Pages

  • modules and random numbers
    ... I've been using the rand function but it seems ... The number of duplicates goes up exponentially as I generate ... someone give me a short snippet of code to show how I would generate a ... Dan Miller ...
    (perl.beginners)
  • math::trulyrandom
    ... I've been using the rand function but it seems ... The number of duplicates goes up exponentially as I generate ... someone give me a short snippet of code to show how I would generate a ... Dan Miller ...
    (comp.lang.perl.modules)
  • Re: Generating Random numbers.
    ... See help on RAND function. ... See John McGimpsey's site for Random numbers with no duplicates. ... Gord Dibben MS Excel MVP ...
    (microsoft.public.excel.misc)
  • Re: math::trulyrandom
    ... The number of duplicates goes up exponentially as I generate ... numbers in the required range using only perl's ... rand function. ... sub create_rand { ...
    (comp.lang.perl.modules)