How do I randomly choose from a list in Excel?
So let's say that I want to create a fake listing of bank transactions. I want all 1000 transactions to happen at 1 of four branches:
1. Eastern Ave
2. Wall Street
3. 112th Ave
4. Broadway
How do I tell Excel to pick from my list of 4 branches and populate the list?
Here's my take
There are multiple ways to do it using rand function - based on probability distribution etc.
However for the sake of a single-cell formula to fill the list: =IF(RANDBETWEEN(1,4)=1,"Eastern Ave",IF(RANDBETWEEN(1,4)=2,"Wall Street",IF(RANDBETWEEN(1,4)=3,"112th Ave","Broadway")))
And you basically want to hard copy the list (special paste value) to another tab/sheet to avoid the list changing everytime you refresh the worksheet.
Cheers
Maybe this is a bit more elegant and easier to expand: - Assume your branch locations are in E4:E7 - Use formula: =INDIRECT("E"&RANDBETWEEN(4,7))
i'm going to try this when i'm back at the office, thanks euro
i had seen solutions that looked more like hswc but I was thinking there had to be a more simplistic way
Saepe esse enim et delectus sit voluptatem. Beatae expedita eos et cumque.
Illo autem quos laudantium sequi nam id. Facere rerum eligendi magni et officia cum. Sequi iusto et ut porro id. Ut ex nobis voluptatibus et. Architecto earum eum vel omnis excepturi. Enim alias ut quia sit hic officiis explicabo. Quia voluptas eligendi perspiciatis est natus amet.
See All Comments - 100% Free
WSO depends on everyone being able to pitch in when they know something. Unlock with your email and get bonus: 6 financial modeling lessons free ($199 value)
or Unlock with your social account...