Today let’s look at RANDBETWEEN to generate some random numbers, but we can combine the function with others in Excel which is exactly what we are going to do today. This solution is in response to a question from a subscriber who wanted to be able to generate EVEN random numbers. He did not want any ODD numbers in his random data. But let’s cover generating Random ODD numbers too, they are pretty much identical in process).
(if you want to see my previous related blog posts you can check them out below
Related blog posts.
How To Pick A Winner Using Excel
Generate Random Dates With RANDBETWEEN
Generate Random Numbers With Excel
You can check out today’s example and download the workbook below if you want to play around with functions.
[wpdm_package id=’9877′]
So the syntax of the ODD and EVEN functions are:
=ODD(number)
=EVEN(number)
Where number is the value to round up to the closest ODD or EVEN number.
We are combining it with the =RANDBETWEEN whose syntax is:
=RANDBETWEEN(bottom,top)
Bottom- the LOWEST number the function is to use
Top – the HIGHEST number the function can use
So let’s put all this together and get some randomness going and begin with generating some ODD numbers between 100 and 500. Excel generates the RANDOM number between 100 and 500 these are our BOTTOM and TOP values, it will then round the values to the nearest ODD numbers. Cool huh?
And you guessed it, the same with our EVEN numbers generation.
So let’s get some EVEN randomness going and begin with generating some EVEN numbers between 100 and 500. Excel generates the RANDOM number between 100 and 500 these are our BOTTOM and TOP values, it will then round the values to the nearest EVEN numbers.
I hoped you like liked today’s #formulafriday.
Dont forget to sign up to the Excel at Excel Newletter for 3 free Excel tips the first Wednesday of the month. Just click on the Sign Up Form to the right or use the link below.