+ Reply to Thread
Results 1 to 3 of 3

Convert to integer?

  1. #1
    Registered User
    Join Date
    10-30-2006
    Posts
    30

    Convert to integer?

    I need to create a random integer.

    I've entered this: =RAND()*1000

    But I need the raw number to be an integer and since I'm referring to the value from another cell, I can't just use cell formatting.

    Is there a way to get the original random number to be an integer, no decimals?

    Thanks

  2. #2
    Registered User
    Join Date
    10-30-2006
    Posts
    30
    Answered my own question. Used this ...

    =FLOOR((RAND()*1000),1)

  3. #3
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097

    Thumbs up

    Quote Originally Posted by JohnLayne
    Answered my own question. Used this ...

    =FLOOR((RAND()*1000),1)
    Hi John,

    You don't need the extra ()

    =FLOOR(RAND()*1000,1)

    a few other examples give the same result as well

    =ROUND(RAND()*1000,1) or variation on ROUND

    =INT(RAND()*1000)

    oldchippy

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1