title: RAND gives #n/a
body: <p>in excel I have </p>
  
  <pre><code>Sex   Probability     Cumulative Prob
  M     80%             80%
  F     20%             100%
  </code></pre>
  
  <p>These are in a sheet called probability of Client and run from cells <code>E1:G3</code>. </p>
  
  <p>In another worksheet i have put the below formula in. Most of the time the result is <code>#N/A</code> with the occasional 'M'. How can i choose this so either M or F is picked in line with the probability above. </p>
  
  <pre><code>=INDEX('Probability of client'!$E$2:$E$3,MATCH(RAND(),'Probability of client'!$G$2:$G$3))
  </code></pre>
  
  <p>thanks</p>