Random sampling from a multivariate normal distribution is essential for Monte Carlo simulations in many credit risk models. For a portfolio of N obligors, standard methods usually require O(N2) calculations to get one random sample. In many applications, the correlation matrix has a block structure that, as we show, can be converted to a “quasi-factor” model. As a result, the cost to get one sample can be reduced to O(N). Such a conversion also enables us to check whether a user-defined “correlation” matrix is positive semidefinite and “fix” it if necessary in an efficient manner.