That worked (with a modification and a fix). You forgot to put #review as '#review' (easily fixed) and I added a format_number at the beginning so I didn't have a 6 decimal answer.
The modified formula for anyone else interested
Code:
program:format_number(
r = test(field('#chapters'),ifempty(field('#reviews'),'0'),'0');
c = ifempty(field('#chapters'),'1');ans = divide(r,c);
cmp(ans,0,'','',ans),"{0:5.1f}")
I removed the comments, as they are explained above, for anyone interested. eschwartz, I appreciate your help.