Looking into this, two possible ways of doing this;
1. Formula
I could not work out the formula to do this but intuitively I think it will require a concatenation as per @Chuck Krussel comment. I would add that I was trying to do this using the following formulas;

2. Using a group step and a series of tables
Table one; upload table that does not go anywhere just load the data
Table two; Upload step is using existing table, source Table one, group by the Group Categ concatenated column, formula to create the Counter
Table three; Upload step is using existing table, source Table one, lookup in to table two using the Group Categ concatenated column to bring in the Counter
Not sure I will have time to have a go at option two before Christmas but will update you if I do. Not an easy one.