Hi Markus,
Here is a version of script which simply searches and gets the positions of the max values in duplication blocks: ////////////////////////////////////////////////////////
reducedup -r 2 iy:=(col(A),col(C)) method:=max xcount:=<new>; //reduce dups, and extract dup Xs with count
worksheet -a 3; //add 3 columns
csetvalue col:=col(H) formula:="list(col(F),col(A))"; //Start row of dup block
csetvalue col:=col(I) formula:="col(E)[xindex(col(F),col(E))]"; //Max in dup block
range rf=col(F);
for(ii=1 ; ii>0; ii++) { //loop over duplication block
if(rf[ii]==NA()) Break;
for(jj=1; jj<=col(G)[ii]; jj++) { //loop within dup block
if(col(I)[ii]==col(C)[col(H)[ii]+jj-1]) { //find max position
col(J)[ii]=col(B)[col(H)[ii]+jj-1];
Break;
}
}
}
////////////////////////////////////////////////////////
Hope this helps.
--Hideo Fujii
OriginLab