View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.newusers
macropod[_2_] macropod[_2_] is offline
external usenet poster
 
Posts: 293
Default Create 5 of 6 digits randomly.

Hi Dave,

Unfortunately, that approach drops the leading 0s from the value returned by the RAND function. You could use:
=--(A1&TEXT(INT(RAND()*10^5),"00000"))

--
Cheers
macropod
[MVP - Microsoft Word]


"Dave Curtis" wrote in message .. .
Hi Shaun,

Simplifying macropods answer slightly, you can use

=--(A1&INT(RAND()*10^5))

to give you the result you need. The double negative coerces the result of
the concatenation into a number.

Dave

url:http://www.ureader.com/msg/10356918.aspx