So I have a big ask:
- I have a grid "standard number sequencing" which has the following columns:
- Site Name
- Department Name
- Start Sequence Number
- Number of Procedures Allocated
I have a second grid to determine the list. I have completed this in excel and will paste the formula below, but I want to have Smart Sheet auto-number my documents based on criteria.
Criteria 1: Site Name
Criteria 2: Department Name
Criteria 3: Start Sequence Number
Whenever Site & Department are entered, the system will automatically determine the next number in the sequence defined on "Standard Number Sequencing" grid.
So if I am looking at a document which site and department indicates it should be betwwen 7440 and 7450 but the list already has 7440, 7441, and 7442 allocated, the system will determine 7443 to be the next in sequence.
Is this possible?
<=IFERROR(IF([@[Confirmed?]]<>"",[@[Confirmed?]],"BCP-"&LET(b,XLOOKUP(P2&Q2,SITE_DEPT_NUMBER_LIST[Site Name]&SITE_DEPT_NUMBER_LIST[Type of BCP Document],SITE_DEPT_NUMBER_LIST[Start]),c,XLOOKUP(P2&Q2,SITE_DEPT_NUMBER_LIST[Site Name]&SITE_DEPT_NUMBER_LIST[Type of BCP Document],SITE_DEPT_NUMBER_LIST[End]),IFERROR(IF(ROW()=2,b,IF(AND(ROW()<>2,MAX(--(RIGHT(FILTER(O$1:O1,(P$1:P1=P2)(Q$1:Q1=Q2)),4)))<c),MAX(--(RIGHT(FILTER(O$1:O1,(P$1:P1=P2)(Q$1:Q1=Q2)),4)))+1,"NN")),XLOOKUP(P2&Q2,SITE_DEPT_NUMBER_LIST[Site Name]&SITE_DEPT_NUMBER_LIST[Type of BCP Document],SITE_DEPT_NUMBER_LIST[Start])))),"")/>