the code provided by CountZero works perfectly, thanks once again for everybodys help!
In reply to Re^2: Imputation of data by garyboyd in thread Imputation of data by garyboyd