I need to create some data for a simulation. So I wanted to take a spreadsheet, and for each column, fill it with random data falling within a domain. A uniform distribution is good enough.
For a binary variable, I am currently doing following steps:
- create a formula like
if(rand()>0.5, "black", "white")in a new column
- fill a column with it, careful to only do it for the amount of rows I want (not just select the whole column and copy into it)
- copy the results and do
paste specials -> valuesin the original column
But if I have a variable with 7 possible values, I can't think of anything better than 7 nested if statements.
Are there better ways?