Six digit random number generator?

Is there a formula or function I can use to generate 500 or so six digit random numbers? I need to assign unique six digit numbers for keypad access to a restricted area.


Thanks,

Bjohnston

Posted on Sep 28, 2019 4:30 PM

Reply
16 replies

Sep 28, 2019 5:23 PM in response to bjohnston

Hi Bjohnston,



Formula in B2 =RANDBETWEEN(0,9)

Fill right to G2 then fill down.


Formula in H2 (and fill down) =B2&C2&D2&E2&F2&G2


Formula in I2 (and fill down) =COUNTIF(H$1:H2,H2)

That will check for duplicates. Any value greater than 1 is not unique.


Now select Column H, copy then Menu > Edit > Paste Formula Results

That will freeze the values.


Regards,

Ian.


Sep 30, 2019 2:04 PM in response to bjohnston

Hi Bjohnston,


Locking will not stop the RANDBETWEEN function from recalculating with every little change to the document.

You can "freeze" the results by replacing formulas with the last calculated values.

Select the whole table (click on the "Bullseye" top left).



Menu > Edit > Copy

Menu > Edit > Paste Formula Results.


Regards,

Ian.


P.S. before you do that, you may want to Save as Template to preserve the formulas for future use.

Ian.


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.

Six digit random number generator?

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