Spreadsheet: 881982d1730221237-assigning-students-to-courses-based-on-two-first-choices-and-two-reserve-choices-example
Sheet: example

Name | Course 1 | Course 2 | Course 3 | Course 4 | Course 5 | Course 6 | Course 7 |  | Assigned course | Choice |  |  | No. of students | [NAME] no. of students
Student 1 |  | 1 | R |  | R |  | 1 |  | Course 2 | 1 |  |  |  | 30
Student 2 |  | R | 1 |  | R |  | 1 |  | Course 3 | 1 |  |  |  | 23
Student 3 |  | R | 1 |  | 1 |  | R |  | Course 3 | 1 |  |  |  | 29
Student 4 | R | 1 | 1 |  | R |  |  |  | Course 2 | 1 |  |  |  | 24
Student 5 |  | 1 |  | R | R | 1 |  |  | Course 6 | 1 |  |  |  | 25
Student 6 |  | 1 | R | 1 |  |  | R |  |  |  |  |  |  | 23
Student 7 |  |  | 1 | R | 1 |  | R |  |  |  |  |  |  | 22
Student 8 |  | 1 | 1 |  | R
Student 9 |  |  | R | R | 1 | 1
Student 10 | R | 1 |  | R |  |  | 1 |  |  |  |  | Choice | No of students
Student 11 | 1 | 1 |  |  | R |  | R |  |  |  |  | 1
Student 12 |  | R | 1 | R |  |  | 1 |  |  |  |  | R
Student 13 |  | R | R | 1 |  |  | 1
Student 14 |  | R | R |  | 1 |  | 1
Student 15 |  | 1 | 1 |  |  | R | R
Student 16 |  | 1 |  | 1 | R | R
Student 17 | R |  | 1 |  | R |  | 1
Student 18 |  |  |  | 1 | R | 1 | R
Student 19 |  | R | 1 | R | 1
Student 20 | 1 | R |  |  | 1 |  | R
Student 21 | 1 |  | R |  | 1 |  | R
Student 22 |  | R | 1 |  |  | R | 1
Student 23 |  | 1 | 1 |  | R |  | R
Student 24 |  | 1 | 1 | R | R
Student 25 | 1 |  |  | 1 | R |  | R
Student 26 |  | 1 |  | R | 1 |  | R
Student 27 | 1 | R |  | R | 1
Student 28 |  |  |  | R | R | 1 | 1
Student 29 | R | R | 1 | 1
Student 30 | R | R |  |  |  | 1 | 1
Student 31 | R | R | 1 |  | 1
Student 32 |  | R | 1 | 1 | R
Student 33 |  | 1 |  | 1 |  | R | R
Student 34 |  | R | 1 |  | R |  | 1
Student 35 | R |  |  | 1 | 1 |  | R
Student 36 |  | 1 | 1 | R |  |  | R
Student 37 |  | 1 | R |  | R |  | 1
Student 38 |  | 1 | 1 |  | R |  | R
Student 39 |  | 1 |  | 1 | R | R
Student 40 |  |  | 1 | R | 1 |  | R
Student 41 | 1 | 1 |  | R |  |  | R
Student 42 |  | 1 | R | R |  |  | 1
Student 43 |  | R | 1 |  | 1 | R
Student 44 |  |  | R | 1 | 1 |  | R
Student 45 |  | R | 1 | R |  |  | 1
Student 46 |  | 1 | R |  | R |  | 1
Student 47 | R | 1 |  |  |  | R | 1
Student 48 |  | 1 | 1 | R | R
Student 49 | 1 | 1 |  |  | R |  | R
Student 50 | 1 |  | R | 1 | R
Student 51 |  | R | 1 |  | R |  | 1
Student 52 | R | 1 | R |  | 1
Student 53 |  | 1 | R | R |  | 1
Student 54 | 1 | R | 1 |  |  |  | R
Student 55 |  | 1 |  | R |  | R | 1
Student 56 |  | 1 | R |  | R |  | 1
Student 57 |  | R | 1 |  | R |  | 1
Student 58 |  |  | 1 | R | R |  | 1
Student 59 |  | R | 1 | R |  |  | 1
Student 60 |  | R | R | 1 | 1
Student 61 |  |  | 1 |  | R | R | 1
Student 62 |  | R | R |  | 1 |  | 1
Student 63 | 1 | R |  |  | R |  | 1
Student 64 | 1 | 1 |  |  | R |  | R
Student 65 |  | 1 | 1 |  | R |  | R
Student 66 |  | 1 |  |  | R | R | 1
Student 67 | R |  | 1 | R |  |  | 1
Student 68 |  |  | R | 1 | 1 |  | R
Student 69 |  |  | 1 | R |  | 1 | R
Student 70 | R |  | R | 1 | 1
Student 71 |  | 1 |  | R | 1 |  | R
Student 72 |  | 1 | 1 | R |  | R
Student 73 |  | R |  | R |  | 1 | 1
Student 74 |  | 1 |  |  | 1 | R | R
Student 75 | R | R |  | 1 | 1
Student 76 |  |  | 1 |  | 1 | R | R
Student 77 | R | R |  |  | 1 |  | 1
Student 78 |  | 1 | 1 | R | R
Student 79 |  |  | R | 1 | R |  | 1
Student 80 | 1 | 1 | R |  |  | R
Student 81 |  | R |  |  | 1 | R | 1
Student 82 | R | 1 |  |  | R |  | 1
Student 83 |  |  | 1 | R |  | 1 | R
Student 84 |  | R |  | R |  | 1 | 1
Student 85 | 1 |  |  | 1 | R |  | R
Student 86 |  | 1 | R |  | R |  | 1
Student 87 |  | R |  |  | R | 1 | 1
Student 88 | R | R |  |  | 1 |  | 1
Student 89 |  |  |  | R | R | 1 | 1
Student 90 | R |  | 1 |  | 1 |  | R
Student 91 | 1 | R | 1 |  |  | R
Student 92 |  | 1 | R |  | R |  | 1
Student 93 |  | R | 1 | R |  | 1
Student 94 |  | 1 | R | 1 |  | R
Student 95 | R | 1 | 1 |  | R
Student 96 |  | 1 |  | R | 1 |  | R
Student 97 |  | R | R |  | 1 |  | 1
Student 98 |  | R | 1 | R |  | 1
Student 99 |  | 1 | 1 | R | R
Student 100 |  |  | R |  | R | 1 | 1
Student 101 | 1 |  | 1 | R |  | R
Student 102 | R |  | 1 |  | 1 |  | R
Student 103 |  | 1 | R | R |  | 1
Student 104 | 1 | 1 |  |  | R |  | R
Student 105 | R |  | R |  | 1 |  | 1
Student 106 | R | 1 | 1 |  | R
Student 107 | R | 1 | 1 | R
Student 108 |  |  | 1 |  | R | R | 1
Student 109 |  | R | 1 |  | R |  | 1
Student 110 |  | R | 1 |  | R |  | 1
Student 111 |  | 1 | R |  | R |  | 1
Student 112 |  |  | 1 |  | R | R | 1
Student 113 |  |  | R | 1 | 1 |  | R
Student 114 | R | 1 | R |  |  |  | 1
Student 115 |  | 1 | R |  | 1 | R
Student 116 |  | 1 | 1 |  | R |  | R
Student 117 |  | 1 | 1 |  | R | R
Student 118 |  | R | 1 |  | 1 |  | R
Student 119 |  | R | 1 |  | 1 |  | R
Student 120 |  | R | 1 |  | 1 |  | R
Student 121 |  | R |  | 1 | R |  | 1
Student 122 |  | R |  | 1 | 1 |  | R
Student 123 | R |  | 1 | R | 1
Student 124 | R |  | 1 |  | 1 |  | R
Student 125 | R | 1 |  |  | R |  | 1
Student 126 | R | 1 |  | 1 |  |  | R
Student 127 | R | 1 |  |  |  | R | 1
Student 128 |  | R | R |  | 1 |  | 1
Student 129 | 1 |  | R | R |  |  | 1
Student 130 |  | R | 1 | R | 1
Student 131 | 1 |  | 1 | R |  |  | R
Student 132 |  | 1 | R |  |  | 1 | R
Student 133 |  | R | 1 | R |  |  | 1
Student 134 |  | 1 | 1 | R |  |  | R
Student 135 | 1 |  |  |  | R | 1 | R
Student 136 | 1 | R | 1 |  | R
Student 137 |  |  | 1 |  | R | 1 | R
Student 138 | R | 1 |  |  | R |  | 1
Student 139 |  |  | R |  | 1 | 1 | R
Student 140 |  |  | R |  | 1 | R | 1
Student 141 | R | 1 |  |  | 1 |  | R
Student 142 | R | R | 1 |  |  |  | 1
Student 143 | 1 |  |  | 1 | R |  | R
Student 144 | R |  | 1 |  |  | R | 1
Student 145 |  | R | R | 1 |  |  | 1
Student 146 |  | R | 1 | R |  |  | 1
Student 147 |  | R |  | 1 |  | 1 | R
Student 148 |  | 1 | R |  | R |  | 1
Student 149 |  |  | R | R | 1 |  | 1
Student 150 |  | 1 | R |  | R | 1
Student 151 |  | R | 1 |  | R |  | 1
Student 152 |  | R | R |  | 1 |  | 1
Student 153 | R |  | 1 |  | R |  | 1
Student 154 |  | R | 1 | R |  |  | 1
Student 155 | R | 1 | R |  |  |  | 1
Student 156 |  |  | 1 | 1 | R | R
Student 157 | 1 | R |  | 1 |  | R
Student 158 |  |  | 1 | R | R |  | 1
Student 159 |  | R | 1 |  | 1 |  | R
Student 160 |  | 1 | 1 |  |  | R | R