I have a sheet in which I am trying to create an automatic JOBID. The jobID should be the year of the client's appointment + Parent auto number; for example, in an appointment on 01/02/2024, the jobID would be 24-0001. This appointment may have a follow-up that should be a child of this row, so the job should be 24-0001A. The next appoitment would receive the 24-0002 and so on. I have figure out how to do this with this formula:
=IF(Ancestors@row = 0, "" + IFERROR(MATCH([Row Number]@row, COLLECT([Row Number]:[Row Number], Ancestors:Ancestors, 0), 0), ""), "")
Although, now I have a something that I have not figure out. If the client fills the form for a date on 2025, the count should start again from 0001. For example, if it is on 02/02/2025, the jobID should be 25-0001.
In that case, I may have something like this:
24-0001
24-0002
24-0002A
24-0003
25-0001
24-0004
25-0002
I Have found a way to do this creating a count field and using the formula:
=COUNT(COLLECT([year_app_]:[year_app_], [year_app_]:[year_app_], [year_app_]@row, [Row Number]:[Row Number], <=[Row Number]@row))
But I am not sure how to integrate these two formulas.
Here is a screenshot of my sheet.
Any thought?