Originally Posted by

**joeu2004**
Instead of =CHOOSE(RANDBETWEEN(1,2),"Win","Loss") in D6, use:

=IF(RAND()<$B$2,"Win","Loss")

However, if you want to be 95% confident that the %wins is B2 +/-0.05 (i.e. between 80% and 90% when B2=85%), the sample size n should be (1+INT(...) = ROUNDUP(...,0)):

=1+INT($B$2*$B$3/(0.05/TINV(1-95%,N-1))^2)

where B2 is the expected %wins, B3 is the expected %losses (1-B2), and N is the intended sample size.

Note that this is a bootstrap formula; we substitute N=n each iteration. For example, if N=34 initially, the formula returns 212. Substituting N=212, the formula returns 199. Substituting N=199, the formula returns 199 again.

So the sample size should be at least n=199 in order to be 95% confident that the %wins will be between 80% and 90%, given B2=85%.

## Bookmarks