I have a text column with repeated values, for example:
| A | ---|---------| 1 | emails | 2 | foo | 3 | foo | 4 | bar | 5 | bar | 6 | stuff | 7 | stuff | 8 | stuff |
What I would like to do is to have another column with numbers, so that each number matches the value in the first column, for example:
| A | B | ---|---------|---------| 1 | emails | number | 2 | foo | 1 | 3 | foo | 1 | 4 | bar | 2 | 5 | bar | 2 | 6 | stuff | 3 | 7 | stuff | 3 | 8 | stuff | 3 |
Depending on what you mean by value –
If you mean ‘repeating group’ then a macro like this may work –
If you mean 'take the number at the end of each value in column A' then this may work -
Edit - According to the OP's comment, I'm guessing they mean 'repeating group' but I'll leave both code samples here.
Edit - Copy and paste the code into the excel Visual Basic Editor and click play. Replace the constants 2 and 12 with the values of your start and end rows.