# Probability of Failure in Excel

Suppose I have probability of failure p = 0.2. Failure is defined as 0 and success is 1. How can I simulate this on an Excel cell (such that I can drag it down)? That is, a formula that yields 0 with a probability of 20% and 1 with 80%.

Thanks!

## Answers

The rand function returns a decimal between 0 and 1. If it's less than .2, you can consider it a failure.

=IF(RAND()<0.2,0,1)