Home > Enterprise >  Fill a list of Patients to a list of Doctors by order
Fill a list of Patients to a list of Doctors by order

Time:10-30

I have a list of patients ordered by date (or manually insert to the end of the column): enter image description here

Or enter image description here

Please help. Here is the demo of what I need: enter image description here


enter image description here

CodePudding user response:

something more advanced:

=INDEX(IFERROR(VLOOKUP(SUBSTITUTE(D2:D, " ", CHAR(13)), 
 SPLIT(FLATTEN(TRIM(QUERY(REGEXREPLACE(SUBSTITUTE(QUERY({ 
 FILTER(TEXT(ROW(A2:A), "000000")&"×"&A2:A, A2:A<>""), ARRAY_CONSTRAIN(FLATTEN(TRANSPOSE(
 FILTER(TEXT(ROW(D2:D), "000000")&"×"&D2:D, D2:D<>"")&T(SEQUENCE(1, 
 ROUNDUP(COUNTA(A2:A)/COUNTA(D2:D)))))), COUNTA(A2:A), 2)}, 
 "select max(Col1) group by Col1 pivot Col2"), " ", CHAR(13)), 
 "^(\d ×)", ),,9^9))), " "), SEQUENCE(1, ROUNDUP(COUNTA(A2:A)/COUNTA(D2:D)), 2), 0)))

enter image description here

demo spreadsheet

  • Related