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 special -> valuesin the original column
But if I have a variable with seven possible values, I can't think of anything better than seven nested if statements.
Are there better ways?