title: Generate two different random numbers in Excel
body: <p>I'm using Excel for Office 365. I would like to generate either a number between 10 and 12 if a give cell (H5) equals 20 or a number between 1 and 12 if H5 is any other number. Here's my code&quot;</p>
  <p><code>=IF(H5=&quot;20&quot;, RANDBETWEEN(10, 12),  RANDBETWEEN($B$3, $C$3))</code></p>
  <p>Currently the code just returns a random number between 1 and 12 no matter what.</p>