Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want your help for the following points:

  1. How generate integer values using Data menu > Data Analysis > Random Number Generation or (if this action can't be done)

  2. how round multiple cells in same time ? I have 120 generated values (using Random Number Generation) and avoid writing 120 times ROUND(A1, 0) ... ROUND(A120, 0), etc...

  3. When I want to create a histogram with integer values, I can't because Excel returns (Data menu > Data Analysis > Histogram) at Bin field (after him is Frequency field), double values (with comma) .

share|improve this question
up vote 2 down vote accepted

The typical way to perform the same action on many cells is to create the data in columns. The first column is your data, the column to the right of that is your data after that action. So, you would put =ROUND(A1,0) in cell B1. Now, drag the bottom right corner of B1 down the full length of the data in A. The B column will be automatically filled in with =ROUND(A1,0), =ROUND(A2,0) ... =ROUND(A120,0).

Now, to answer your question more specifically. If you want random integers, a simple way to do it is enter in a cell:


This you can then drag down the bottom right corner of that cell just like I described above. You will end up with a column of random integers between 0 and 99.

Unfortunately, I don't have the Data Analysis tools in my version of Excel, and I don't quite understand your third question anyway. Can you clarify it a bit?

share|improve this answer
FYI, =INT(RAND()*100) will generate a random number from 0 to 99 (inclusive), and never 100, as RAND() returns on the interval [0,1). You might also be able to use the function RANDBETWEEN(x,y) to return a value in the interval [x,y] (ie, inclusive at both ends), but I don't think it's always available. – DMA57361 May 6 '11 at 16:16
@DMA57361 Thanks for the clarification. Sorry I missed that. I corrected my answer. – ford May 7 '11 at 19:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .