Search code examples
google-sheets

Google Sheets: formula to show an incremental counter number for equal values in other column


I have two columns A and B. Column A is populated with 'colours' I need a formula to show in column B an incremental counter number for equal values in Column A. Plase, take a look at this working example to see what I mean: https://docs.google.com/spreadsheets/d/1khYw67ZcIPhzPMijlqS45mirmQSV3d68i3GEXbTpikU/edit?usp=sharing

enter image description here


Solution

  • COUNTIFS() is the standard way to make counters like this.

    =ARRAYFORMULA(IF(ROW(A:A)=ROW(A1),"Counter",IF(A:A="",,COUNTIFS(A:A,A:A,ROW(A:A),"<="&ROW(A:A)))))