Hi, this is Wayne again with a topic “Generating Random Numbers in Excel”.
In this tutorial, I will show you how to quickly generate random numbers in Excel every once in a while you’ll find yourself in a situation in Excel when you might need to have a random number and we’re going to look at how to generate two different kinds Of random numbers, the first example is a random number between 0 and 1. To do this, all you have to do is click on a cell type, the equal sign and then type in Rand, and you can see the pop up here. It tells me what Rand does returns a random number greater than or equal to 0 and less than 1 and notice what it says here, changes on recalculation, I think you’ll see what that means in just a minute, so after typing equals Rand. All I have to do is put in a left parenthesis and then a right parenthesis, there’s nothing to put between the two then just tap enter on the keyboard and you have a random number between 0 and 1. Now, what if I want a series of random numbers? Well, all I have to do is use the autofill handle if you’re not familiar with the autofill handle watch, one of my other tutorials that teaches about the autofill handle, but it’s a wonderful tool that makes just this kind of thing really easy.
So I want a series of random numbers. This is a random number. All I have to do is click on the cell, that has the rand function and the formula. So that’s this go to the lower right corner, where there’s a little green square. Put my mouse on the green square and then click and drag down I’ll, just go down to row, number 12 I’ll release and a whole series of random numbers gets generated. Now you may have noticed that my first random number actually changed a little bit. It gets recalculated whenever you redo it or adjust any of the random numbers. Look they all pretty well change, okay, so now that I’ve got the random number, what I could do is click on column B to select the entire column and then, if I wanted to, maybe I could click up here on percentages and that changes the decimals into A percentage 79 percent, 82 percent – that’s a little bit more readable and understandable for some people.
Now what if you just want a random number between 5 and 5,000 or between 1 and 10,000, and you want it to be whole numbers, not decimal. Well, in that case, you use a little bit different function and formula. In that case you type equals R and between and notice what it says, returns a random number between the numbers. You specify you put in a left parenthesis and then the lowest number that you want it to maybe generate so one.
In this case, comma and let’s say five thousand is the highest number and then I put in the right parenthesis and tap enter on the keyboard. There is my random number between one and five thousand now notice, even doing that changed my random numbers over here in column B. Alright, now I can use the autofill handle to pull this down and I’ll get a series of random numbers. None of these are less than zero, and none of them are more than 5,000 to test this out.
To make sure it’s really working, I could do randbetween left parenthesis and, let’s say five comma nine, so this will be a lot easier to see if it’s really working, every number that’s generated should be between five and nine, and that is the case all right. So now that we’ve got these random numbers, what if I want them to stop recalculating? If I’m happy with this random set of numbers, I don’t want them to keep changing. So what I could do is select the range of numbers by clicking and dragging, and then I could copy that information. I just did ctrl C to copy, and then I could click in another column, just pick a cell I’ll just pick this cell here and I’ll.
Do a paste special so here and paste I’m just gon na go down to paste special and I’ll choose values, so it’s gon na paste, just the values. So now, if you click on one of the numbers, these were randomly generated, but they were generated here in this column using the randbetween function, and you can see that here in the formula bar up here. But these numbers are just numbers: I copied formulas and pasted them using paste special as values, so these numbers will not change in the future, even though these clearly will you saw it change before your eyes just a minute ago. So I could do the same thing with these numbers select the range ctrl C to copy click here, and I want to paste it, but remember I need to do a paste special. So I go here to the I’m part of the paste button and at the very bottom of that paste, special values, click, OK and those exact values got pasted and of course I could change them again to percentages now. These numbers will continue to change because they still are random, but these are set in stone, they’re, just values.
So now, with that done, if I wanted to, I could just copy paste this column title over, delete the column, that’s randomized, because it’ll keep changing or actually I could just copy the values and paste them on top of the formulas and then delete this column here. However, you want to do it, but now I have generated random numbers and these are stable ones. They won’t just keep changing thanks for watching. I hope you found this tutorial to be helpful. If you did please like follow and subscribe and when you do subscribe, click. The bell, next to the subscribe button that way you’ll be notified whenever I post another video and watch for another video from me at least every Monday.
If you’d like to support my channel, become a supporter of mine through my patreon account and you’ll see a link to that in the description below speaking of patreon. I want to give a quick shout out to my five-dollar patreon supporters. They include Sharman kurt joshua aaron bill nicole and men. Well, thank you so much for supporting my channel.
Also, thank you to those who support me with fewer than five dollars. I appreciate you as well. .