# StudentCourseEnrollmentFormat
## When to use
A course tab has a single column of pasted roster text in column A (header `Students` in A1), and the user wants it split into structured columns. Also use when asked to "do the same as GAME 1303" for other course tabs.
## Source string format
```
Amarion Wilson (200004888) - Collin College/Undergraduate (A.A.S.) - 08/12/2024 - Active
Fozaan Sheikh (100592042) (Private) - Collin College/Undergraduate (A.A.S.) - 08/14/2023 - Active
Jayden Vaughn (CC1005642) - Collin College/Undergraduate (A.A.S.) - 12/15/2025 - Active
```
Variations to handle:
- An optional `(Private)` marker after the CWID parentheses.
- CWID is usually numeric but can be alphanumeric (e.g. `CC1005642`) — keep those as text.
- Degree can be a slash-joined list: `A.A./CER1/A.A.S.`, `CER1/OSA/A.A.S.`
## Output columns
| Col | Header | Content |
|---|---|---|
| B | `Name'` | Student name (note the trailing apostrophe in the header — match GAME 1303) |
| C | `CWID` | ID inside the first parentheses, numeric when possible |
| D | `Degree` | Text inside the parentheses after `Undergraduate ` |
| E | `Date /started` | Date, formatted `m/d/yyyy` |
| F | `Status` | Trailing status, usually `Active` |
## Steps
1. Read each target sheet's used range in column A to get the last data row. Skip sheets whose used range is empty (e.g. a tab with no roster yet) and report them.
2. Write headers to `B1:F1`, bold, Arial 10.
3. Write these seed formulas to `B2:F2`, then `autoFill` down to the last row (use `execute_office_js`; anchor on `") - "` after `"Undergraduate ("` so the `(Private)` marker doesn't shift offsets):
- B: `=TRIM(LEFT(A2,FIND(" (",A2)-1))`
- C: `=IFERROR(VALUE(MID(A2,FIND(" (",A2)+2,FIND(")",A2)-FIND(" (",A2)-2)),MID(A2,FIND(" (",A2)+2,FIND(")",A2)-FIND(" (",A2)-2))`
- D: `=MID(A2,FIND("Undergraduate (",A2)+15,FIND(") - ",A2,FIND("Undergraduate (",A2))-FIND("Undergraduate (",A2)-15)`
- E: `=DATEVALUE(MID(A2,FIND(") - ",A2,FIND("Undergraduate (",A2))+4,10))`
- F: `=MID(A2,FIND(") - ",A2,FIND("Undergraduate (",A2))+17,50)`
4. Format body `B2:F<last>` as Arial 10; set `E2:E<last>` numberFormat to `m/d/yyyy` (pass a 2D array sized to the range).
5. `autofitColumns()` on `A1:F<last>`.
6. Verify: read back B:F and confirm no `#VALUE!`/`#NAME?`, and spot-check at least one `(Private)` row and one non-numeric CWID row if present.
**Done when:** every non-empty source row has all five fields populated, dates render as `m/d/yyyy`, and the read-back shows no error values. Report the per-tab student count and name any tab skipped for having no data.