Hi
(relates to Numbering an ID with some specific criteria)
Sample
Range A2:A11 aka SmallRange consists of non-unique IDs desordered
Goal
With formula only, generate a countif array. Expected result in green columns

Options so far
B2: =COUNTIF(OFFSET(A2,,,SEQUENCE(ROWS(SmallRange))),SmallRange)
C2: =BYROW(LargeRange,LAMBDA(Id,COUNTIF(A2:Id,Id)))
D2: =MAP(LargeRange,LAMBDA(Id,COUNTIF(A2:Id,Id)))
Unfortunately none seem to scale. In this file LargeRange consists of 100k rows and 100 unique IDs for checking and to dev. other options...
My current LAMBDA based solution that performs (I think) "decently" considering that range is avail. here
Thanks