google-sheets-formula

Arrayformula Serial Number by Groups


I have : https://docs.google.com/spreadsheets/d/12bz_CWHE1xc7JDvwCVLUCkxSgFmgZQy4-m7OMZ-kAjU/edit?usp=sharing

The expected results are as in column D

and have been successful with the drag down formula : =IF(B2="";;MATCH(B2;UNIQUE(FILTER(B$2:B;A$2:A=A2));0))

But I need an arrayformula to complete it, in order not to manually drag down every time to add a row between them.

I thank you in advance for your help


Solution

  • Converting your drag-down formula to array-style:

    =map(B3:B,lambda(Σ,if(Σ="",,xmatch(Σ,unique(filter(B:B,A:A=offset(Σ,,-1)))))))
    

    enter image description here