I have two columns in my Sheet, one for the serial numbers and the other for the category.

I want the numbers to be sequential as long as they are in the same category, but if the category changes, I want the numbers to start over for each category.

And I want all of this to be in Arrayformula.

Note: I was able to do the first part, but I could not make it into Arrayformula.


1 Answer 1


Assuming that the category names are in column B2:B, put this formula in row 2 of a free column:

=arrayformula( iferror( 1 / countifs( B2:B, B2:B, row(B2:B), "<=" & row(B2:B) ) ^ -1 ) )

  • Thank you vary much .... it work great. thank you again Jul 5 at 14:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.