Microsoft Excel Tutorial: Randomly choose between Yes and No or any two choices.
Excel randomly choose Yes or No.
Use CHOOSE and RANDBETWEEN for a roughly 50/50 split.
Or use IF and RAND to generate an approximate percentage of one or the other.
Welcome to another Excel Shorts video! Today, we're going to talk about how to randomly choose between yes or no in Excel. It's a common dilemma when making decisions, and Excel has a simple solution for it.
First, let's discuss the RANDBETWEEN function. This function generates a random number between two specified values. In our case, we want to generate either 1 or 2. So, we use the formula =RANDBETWEEN(1,2). This will give us a random number between 1 and 2 every time we press F9.
But how do we turn this into a yes or no decision? That's where the CHOOSE function comes in. We can use the RANDBETWEEN function as the index number for the CHOOSE function. So, if the RANDBETWEEN function gives us 1, we get "Yes" and if it gives us 2, we get "No". Simple, right?
But what if we want to have more control over the percentage of yes or no? We can use the IF function to achieve this. We can set a condition that if the RAND function (which generates a random decimal between 0 and 1) is less than or equal to 20%, we get "Yes", and if it's greater than 20%, we get "No". This may not be perfect, but over thousands of times, it will work out to be around 20% yes and 80% no. However, in some instances, like in our example, it may not be exactly 20%. But that's the beauty of randomness!
If you found this video helpful, please give it a thumbs up and subscribe to our channel for more Excel tips and tricks. And don't forget to hit the bell icon to get notified whenever we upload a new video. If you have any questions or comments, feel free to leave them in the comments section below. Thank you for watching and see you in the next video!
Buy Bill Jelen's latest Excel book:
www.mrexcel.com/products/latest/ You can help my channel by clicking Like or commenting below:
www.mrexcel.com/like-mrexcel-on-youtube/ Buy Bill Jelen's latest Excel book:
www.mrexcel.com/products/latest/ #excel #microsoft #exceltutorial #exceltips #microsoftexcel #exceltricks #excelsolutions Table of Contents
(
0:00) Problem Statement: Excel Randomly Choose Yes/No
(
0:11) CHOOSE with RANDBETWEEN for 50/50
(
0:25) Change Percentage with RAND
(
0:46) Clicking Like really helps the algorithm
Join the MrExcel Message Board discussion about this video at
www.mrexcel.com/board/threads/1234868/
@antique-bs8bb
1 year ago
So I guess to get exactly 20% yeses we have calculate N (=20% of number of rows) then use Large N to get a condition, and then I got lost. too much for 60 seconds I guess.
1 |