Hi,

I'm afraid the only true method to ensure a genuinely random selection here would be to enter your formula into 20 cells, use an additional cell to monitor the ratio of Males to Females and then iterate enough times until that cell shows 50%.

Solutions whose calculations for later cells are in some way influenced by results in preceding cells are by definition not random.

Regards