1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

RAND Command In Excel

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

  1. Nelix
    Honorary Member

    Nelix Gigabyte Poster

    1,412
    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
    WIP: 70-294
  2. SimonV

    SimonV Petabyte Poster Administrator

    6,616
    149
    228
    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,412
    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
    WIP: 70-294
  4. SimonV

    SimonV Petabyte Poster Administrator

    6,616
    149
    228
    :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,412
    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
    WIP: 70-294

Share This Page

Loading...