+ Reply to Thread
Results 1 to 10 of 10

Fixed Random Function

  1. #1
    Valued Forum Contributor
    Join Date
    07-16-2007
    Location
    GA
    MS-Off Ver
    Office 365 - Version 2403
    Posts
    1,059

    Question Fixed Random Function

    Hi,

    I have a template in which I'm using a random function to generate (or make up) hours for various projects worked on during specific start & finish dates. Within these projects, I also have 5 primary sub-tasks with handful of secondary tasks.


    The function I'm using is:

    =RAND()*$C$6*100

    $C$6 is pointing to a specified percentage, in this instance 12%


    The problem with my worksheet is now when I edit other areas, my table is randomizing.

    Is there a way to "fix" or 'lock" the randomization, once I have desirable numbers in place? If so, how?

    Thanks
    MyCon
    -- Using Latest Version of Excel

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

    Re: Fixed Random Function

    You'd need to copy the formulas and paste as values.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Valued Forum Contributor
    Join Date
    07-16-2007
    Location
    GA
    MS-Off Ver
    Office 365 - Version 2403
    Posts
    1,059

    Re: Fixed Random Function

    Hi,

    I attached an Excel 2007 file for questioning.

    When reviewing the file, you will see Colums I - R, Rows 27 - 39. In the task areas, I have bunch of random numbers that were generated Estimated Min. Max. hours found in Column D & E & its respective rows.

    This section seems to work well.

    Now, I'm questioning when I edit other areas, such as items found above Row 26, my numbers are being re-randomized.

    Why is this?
    More importantly, how can randomize desired sections - Below Row 26 & then lock it, so it does not modify other calculations?

    Thanks
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: Fixed Random Function

    mycon,

    You need to have the RandomValues stored somewhere othan the present cells and then paste them as values from there so you have a FIxed Desired Random Nos and they dont get re-calculated..

    Just create a Mirro of the same sheet with the Random Funtionality intact and record a macro of copying the values from the desired cells to the actual location..so whenver you need new values just run the Macro..

    Warm Regards
    e4excel

  5. #5
    Valued Forum Contributor
    Join Date
    07-16-2007
    Location
    GA
    MS-Off Ver
    Office 365 - Version 2403
    Posts
    1,059

    Re: Fixed Random Function

    Hi e4excel,

    I had a feeling I would have to do this. I was hoping to avoid this because I'm still creating the worksheet & wanted to minimize having similar worksheets.

    I've seen this done before, but not familiar on how to do this. I've seen some worksheets that has a macro icon to "copy" data from other worksheets.

    If I were to do something like this, will the "copied" information come over as values or as the Random formula being used?

    Also, how do I create a "Copy" macro to get desirable results - In this case, just the estimated randomized hours values to its appropriate cells? I have 5 primary Task sessions with a handful of sub-tasks.

    Thanks

  6. #6
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: Fixed Random Function

    MyCon,

    I have replicated the Sheet and Renamed it as "Actual Formula Cells" meaning that the formula is in this Sheet and I have kep your Sheet as it is without Renaming it..

    Now If you press the key Combination of CTRL+SHIFT+H then the Range of cells get copied into you Actual Sheet as values...and it does not get affected on F9 Evaluation ..

    SO please check the Worksheet..

    I am not good in VBA myself but trying just like you to get somewhere
    I have not witten the code but simply recorded it...!

    Please Login or Register  to view this content.

    Warm Regards
    e4excel
    Attached Files Attached Files

  7. #7
    Valued Forum Contributor
    Join Date
    07-16-2007
    Location
    GA
    MS-Off Ver
    Office 365 - Version 2403
    Posts
    1,059

    Re: Fixed Random Function

    Hi e4excel,

    Thank you very much for your assistance & the file. I will be checking it out shortly.

  8. #8
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: Fixed Random Function

    Your Welcome...

    Hope it helps!

  9. #9
    Valued Forum Contributor
    Join Date
    07-16-2007
    Location
    GA
    MS-Off Ver
    Office 365 - Version 2403
    Posts
    1,059

    Re: Fixed Random Function

    Hi e4excel,

    I finally had a chance to check out your file. Looks like you created a copy function that removes the formulas.

    I suppose this works. After working with my file some more, it appears that some of these randomness is excessively exceeding my project durations. Now, I need to figure out on how to resolve this issue.

    Thanks for the help.

  10. #10
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: Fixed Random Function

    MYcon

    I didnt create anything just recorded the Sequence of steps which get played when you press the CTRL+SHIFT+H key combination..

    As far as the Randomness is concerened that I suppose is at the conceptual lvel for you to decide..
    BUt for getting the Randome Values I think this would be good enough..

    REgards
    e

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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