+ Reply to Thread
Results 1 to 5 of 5

Filtering random numbers without regenerating random numbers

  1. #1
    Registered User
    Join Date
    09-15-2014
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    1

    Filtering random numbers without regenerating random numbers

    This may be a simple problem, but I am using formulas that generate random numbers. I then want to filter the spreadsheet to hide or remove negative numbers, but when I apply the filter the formulas produce new randomn numbers. How can I hide or even delete the rows where the formula produces a negative number without triggering new randomization?

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Filtering random numbers without regenerating random numbers

    You need to remove the formulas. Copy the range and paste special>Values back on top of the existing range.
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Filtering random numbers without regenerating random numbers

    Or use a formula that only generates non-negative numbers.
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Filtering random numbers without regenerating random numbers

    Or set your options>Formulas > to manual calculation.

  5. #5
    Registered User
    Join Date
    09-16-2016
    Location
    Reykjavik, Iceland
    MS-Off Ver
    Excel for Mac 16.61
    Posts
    2

    Re: Filtering random numbers without regenerating random numbers

    I found I needed persisted and/or reproducible random number sequences all the time. Turns out this is possible using only standard spreadsheet formulas.

    One way is to use the so called Lehmer random number method. It generates a sequence of random numbers in your spreadsheet that stays the same until you change the "seed number", a number you choose yourself and will recreate a different random sequence for each seed number you choose.

    The short version:
    1. In cell B1, enter your "seed" number, it can be any number from 1 to 2,147,483,647
    2. In cell B2 enter the formula =MOD(48271*B1,2^31-1) , this will generate the first random number of your sequence.
    3. Now copy this cell down as far as the the random sequence you want to generate.

    That's it! If you want a different set of numbers, just change the seed number in B1. If you ever want to recreate the same set of numbers again, just use the same seed and the same random sequence will appear.

    Note: The random numbers will be in the range 1 to 2,147,483,647. To normalize them to the range 0 to 1 as the results of the built-in RAND function, go to cell C2 and enter the formula =B2/(2^31-1). Then fill that formula down as far as your random number sequence in column B.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Random Selection and Random Numbers
    By thepassfan in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-05-2014, 04:48 PM
  2. Generating a list of Random numbers of random length...
    By Growl in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-19-2013, 12:10 PM
  3. Generating a Random Number of Random Numbers
    By Garrus in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-10-2010, 09:39 AM
  4. Non-random numbers generated by excel's data analysis random gener
    By Allie in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 09-17-2005, 02:05 AM
  5. [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

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