I need some users to have Editor access to be able to enter data into the sheet, but aside from training and a clear job aid, I want them to not delete rows or sort rows.
I have a column that generates a unique code for a course in a term. The first course entered for that term has a code that ends with 01 (e.g., NC60001), the next one has 02 (NC60002), etc. If a course is entered but for a new term, the code ends in 01 (NC90001). The "6" and "9" indicate the term when the course is offered.
If the rows are reordered or deleted, what was the say the second course in the term may become the first course, and the unique code changes from say NC60002 to NC60001. This has an impact in other sheets that use the unique code for payments and instructor scheduling.
I am already using the auto-number feature on the sheet, so I can't use it to generate this unique code.
Aside from training and the job aid, is there any way to prevent an Editor from deleting or sorting rows?
Is there another way to generate this unique code without the auto-number or dependence on the order of the rows?
Here is the formula I use for the unique code:
=IFERROR("NC" + IF(Term@row = "Spring", "1", IF(Term@row = "Summer", "6", IF(Term@row = "Fall", "9", "0"))) + RIGHT("0000" + [H-CRN (Helper)]@row , 4), "")
The formula for [H-CRN (Helper)]
=IFERROR(COUNTIFS(Term$1:Term@row , Term@row , [Fiscal Year]$1:[Fiscal Year]@row , [Fiscal Year]@row ), "")
This second formula generates a number of the order that course is added on the sheet, by Term and Fiscal Year. Like I mentioned earlier, the first one in a term of a Fiscal Year returns 1, the second returns 2, etc. The numbering starts over when a different Term and Fiscal Year is added. Yes, this means a unique code like NC10001 is repeated at the start of the same term in each fiscal year, but that's OK because we use that unique code and a "term code" together to uniquely identify the course.
NC10001-202601 (first course in sheet for FY 2026 in 01 or "spring")
NC10001-202701 (first course in sheet for FY 2027 in 01 or "spring")
NC60005-202606 (fifth course in sheet for FY 2026 in 06 or "summer")