1

I have two columns in my Sheet, one labeled serial number and the other category.

The serial number for each item is based on its category as well as its order in the table, and is numbered using a sequence starting from 1 and incrementing by 1 for each additional item.

Each category uses its own number sequence, so a serial number would be unique within a category, but there would be duplicated numbers between different categories.

I can't figure out how to create an array formula to generate the serial number

Sample Desired Result

serial number category item
1 cat_1 txt_string
2 cat_1 txt_string
1 cat_2 txt_string
3 cat_1 txt_string
4 cat_1 txt_string
2 cat_2 txt_string
3 cat_2 txt_string
1 cat_3 txt_string
0

1 Answer 1

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 ) )

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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