I am pretty sure that %WORKERSD%MAXCASH would generate a random number from 5(maxcash) to 4(workers) which is not really possible. If you want MONEYGAIN to be 5-20, then i suggest storing another variable which multiplies 4 maxcash and 5 workers(assuming that's what you want Nope), and then do %WORKERSD%VARIABLE, and assign that to MONEYGAIN.
EDIT: Mizal got the reply in before me :P
EDIT2: Shoot, I messed that logic up. Yeah, Mizal is right, and I think that you add a MINCASH, and then randomize it with MAXCASH, which could be something dealing with your workers...
Good Luck!