How can I use the RANDBETWEEN function ithout it changing all the time? Excel has a manual calculation option, anything like that?

I just want to be able to get the random numbers when i need them not every time i change any other cell in the project.

null-OTHER

Posted on Feb 2, 2018 5:12 AM

Reply
Question marked as Top-ranking reply

Posted on Feb 2, 2018 5:36 AM

one way is to create a column that is filled with the function randbetween(), then select the column and copy


now select the actual destination that you want fixed, random numbers, and paste using the menu item "Edit > Paste Formula Results"

5 replies

Feb 2, 2018 3:52 PM in response to Falsetto23

HI Falsetto,


Nothing really new here. Just pulling together the suggestions offered by Wayne and SG, and providing illustrations of the ones not involving AppleScript (which could well be your best route here).


Here's an example using a separate table as a 'well' of random numbers. The small table on the right uses RANDBETWEEN(0,100) in each cell except the top one to generate a set of random numbers.

User uploaded file

The non-blank cells in columns A-F contain formulas referencing one of more of the cells in column G. The error triangles in column A are due to the empty cells in column G, are expected, and may be ignored.

Note the numbers and placing of the numbers in the single column table.

These cells are Selected, then Copied.


Turnng to the receiving table, select the first non-header cell in the Paste here column (G2), then go to the Edit menu and make the choice shown.

User uploaded file


Note that the small table has not (yet) changed.

In the menu, select the highlighted item, then release the mouse button to Paste Formula Results.

User uploaded file

The numbers are pasted into the receiving column in the same (random) order in which they were created in the small table, and are picked up from there by the formulas in other parts of the table. In the example, the numbers are sorted in ascending order in column A, using SMALL(G,ROW()-1) filled into the cells of that column.

Note that the pasting of Formula Results has also triggered a recalculation of the small table, providing a new set of random numbers for future use. (The Checkbox in the header cell on this table can also be used to force calculation of a new set of numbers.)


Using a Script:


Once the script is written, and saved as a script or contained in an Automator service, the work flow can be simplified.


The script could be written to use the same two table setup as shown above. Workflow in that case would be:

  1. Select a cell on the small table.
  2. Select the script from the Scripts menu OR
    Go Numbers (menu) > Services > and select the Automator Service.


With minor(?) revisions, it should be possible to remove the 'well' table, and have the script/service place the list directly into the receiving column of the larger table.


And with further revisions, it should be possible to include a list of specific cells in the larger table, and place the script generated random numbers directly into the cells in that list.


Regards,

Barry

Feb 2, 2018 11:26 AM in response to Falsetto23

Falsetto23 wrote:


is there a way to do that automatically when i want it to


Alas, there is no way in Numbers to turn off calculation the way can in Excel.


Not fully automatic, but you could experiment with using a cell formatted as Checkbox to trigger re-calculation of random numbers.


If you post more specifics on what you are trying to do someone here might be able to suggest what might work best.


SG

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How can I use the RANDBETWEEN function ithout it changing all the time? Excel has a manual calculation option, anything like that?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.