RAND Command In Excel

Discussion in 'Microsoft Office Specialist (MOS), Office 365' started by Nelix, Nov 27, 2003.

  1. Nelix
    Honorary Member

    Nelix Gigabyte Poster

    1,416
    3
    82
    Hi all

    Phil will probably get this one right aswell.

    I want to generate a 4 digit random number using the rand command, any cluse on how to do this, I am using Office XP.

    Thanks in advance.
     
    Certifications: A+, 70-210, 70-290, 70-291, 74-409, 70-410, 70-411, 70-337, 70-347
    WIP: 70-346
  2. SimonV
    Honorary Member

    SimonV Petabyte Poster Gold Member

    6,651
    180
    258
    Try this one.

    [code:1:7515d9ba4b]=CONCATENATE(INT(10*(RAND())),INT(10*(RAND())),INT(10*(RAND())),INT(10*(RAND())))[/code:1:7515d9ba4b]
     
    Certifications: MOS Master 2003, CompTIA A+, MCSA:M, MCSE
    WIP: Keeping CF Alive...
  3. Nelix
    Honorary Member

    Nelix Gigabyte Poster

    1,416
    3
    82
    that worked Si, but I sorted this using the following

    =INT(RAND()*(9999-1000)+1000)

    Does your formula rule out duplication?
     
    Certifications: A+, 70-210, 70-290, 70-291, 74-409, 70-410, 70-411, 70-337, 70-347
    WIP: 70-346
  4. SimonV
    Honorary Member

    SimonV Petabyte Poster Gold Member

    6,651
    180
    258
    :scratch dont know mate??
     
    Certifications: MOS Master 2003, CompTIA A+, MCSA:M, MCSE
    WIP: Keeping CF Alive...
  5. Nelix
    Honorary Member

    Nelix Gigabyte Poster

    1,416
    3
    82
    Well i'm not going to sit and try to find out, my formula does'nt prevent duplicates either
     
    Certifications: A+, 70-210, 70-290, 70-291, 74-409, 70-410, 70-411, 70-337, 70-347
    WIP: 70-346

Share This Page

Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.