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
Illum numquam voluptas at vero facere. Quae earum nam architecto. Consequatur quam temporibus voluptas quis. Non quis et non vero cumque.
Modi dolor numquam doloremque corporis ipsam in fuga. Ad nisi nemo est praesentium illum. Dolore reprehenderit sequi vel maxime.
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...