# VBForums UtilityBank > UtilityBank - Utilities >  Correlated Dataset Generator In Excel

## alburns

I have developed a macro-enabled Excel program that creates datasets of variables with user-specified correlations.  The program accommodates normal random variates, scale variables with specified mean, standard deviation, etc. and/or binomial variables.  It is freely available; please share it with others. 

Copy & paste into browser: 

https://tinyurl.com/CorrelatedDatasetGenerator

----------


## Elroy

Ahhh, I did this years ago.  Changing the mean and/or standard deviation doesn't change the correlation, and it's easy to do, as different means and/or SDs are just linear transformations.

Creating a specific correlation is a bit tricky though.  As said, it's been years ago but, if I remember correctly, I just did it by creating a perfect correlation and then swapping random pairs in one of the columns until I got the correlation I wanted (within an epsilon tolerance).

Now, a trickier problem is creating specific bi-variate correlations among three or more columns.  :Smilie:

----------


## Shaggy Hiker

Since it isn't a question, it belongs in either Utilities or the CodeBank. I opted for Utilities because the source isn't included, but a link to a spreadsheet is.

----------

