title: Randomly splitting a dynamic range into equal groups
body: <p>I have a dynamic range of values that I want to split into N groups, where N is specified by the user.</p>
  <p>I want to do the following:</p>
  <ul>
  <li>Split the group into N equal parts.</li>
  <li>Specify which ones in the range that are to be in separate groups.</li>
  <li>Have a &quot;checker&quot; to see if the math works out and it is possible to do (i.e. a group of 11 cannot be split into 2 groups).</li>
  </ul>
  <p>Here is a scenario:</p>
  <ul>
  <li><p>I have a list of 26 values (an array of letters, A to Z).</p>
  </li>
  <li><p>I want two groups, randomly split.</p>
  </li>
  <li><p>I specified 2 of the values where I want them to be separate (i.e. the letter B and X).</p>
  </li>
  </ul>
  <p>This should give me two groups, 13 values of &quot;Group 1&quot; and 13 values of &quot;Group 2&quot;.</p>
  <p>&quot;Group 1&quot; can contain something like (&quot;B&quot;, &quot;N&quot;, &quot;V&quot;, &quot;C&quot;, &quot;T&quot;, ..... x 13)</p>
  <p>&quot;Group 2&quot; contains (&quot;X&quot;, &quot;A&quot;, .... x 13)</p>
  <p>The variables in this case are the # of values, # of groups to split, and specific values to split.</p>
  <p>EDIT: google sheet example:
  <a href="https://docs.google.com/spreadsheets/d/1baZr8QAkFjw1UwsMOyphma6v_MNkWz-aCLx57yPsViE/edit#gid=1454808593" rel="nofollow noreferrer">https://docs.google.com/spreadsheets/d/1baZr8QAkFjw1UwsMOyphma6v_MNkWz-aCLx57yPsViE/edit#gid=1454808593</a></p>