+ Reply to Thread
Results 1 to 3 of 3

Calculate RAND function only once

  1. #1
    Registered User
    Join Date
    11-10-2013
    Location
    New York, US
    MS-Off Ver
    Excel 2007
    Posts
    2

    Calculate RAND function only once

    Hi,

    I have a workbook that calculates a RAND function based on input in another cell. Specifically, the formula in E2 selects a random text string from another range depending on data entered in D2. I want to be able to fill this formula down for use multiple times.

    The formula works fine on its own, but the problem comes when I, say, move on to D3 to input more data. E3 does its random calculation as it should, but E2 also recalculates; I want E2 to remain static once it calculates the first time.

    I am not familiar with VBA, but it looks like the solution may have to come from there. Can anyone help me with this?

    I'm attaching the workbook in question. The calculation I'm referring to is in the 3rd worksheet.

    Thanks!

    TLL Injury Machine.xlsx

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Calculate RAND function only once

    you can use this udf for static rand just place in a new module i looked this up and didn't write it myself
    Please Login or Register  to view this content.
    replace all instances of rand() with staticrand() find replace will do it

    to re-calcalculate just double click in cell and enter if you want to do the lot double click and enter in e2,f2,g2 then fill the formula down again
    ive modified your sample already
    Attached Files Attached Files
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Registered User
    Join Date
    11-10-2013
    Location
    New York, US
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Calculate RAND function only once

    Thanks so much - this does the trick exactly. I'm still learning!

+ 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. RAND function
    By ojh in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-30-2007, 04:05 AM
  2. [SOLVED] HELP with the RAND() Function!!!!!!
    By denise1082 in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 07-31-2006, 03:00 AM
  3. [SOLVED] re: Rand function
    By Susan Hayes in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 11:05 AM
  4. [SOLVED] re: Rand function
    By Harlan Grove in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-06-2005, 06:05 AM
  5. [SOLVED] re: Rand function
    By Susan Hayes in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 01:05 AM

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