Problem with macros

  • Thread starter Thread starter gibertini
  • Start date Start date
G

gibertini

Can someone help me with this problem? The task is something like
this. In one row we have some codes, like a,a,a, b, c, c, d, e, e, e.
In another row I have to mark them so that every code that is unique
has number 1 next to it, and the one that is repeating must have
numbers from 1 to something, depends on the number of repeatings. So
in my case it would look lik this.
1st row 2nd row
a 1
a 2
a 3
b 1
c 1
c 2
d 1
e 1
e 2
e 3
Can please someone make me a macro for this? Thanks,
 
you dont need a macro in fact...
here is the situation:

header(A1) counter(B1)
a =IF(A2<>A1;1;1+B1)
a copy formula seen above
etc
 
you dont need a macro in fact...
here is the situation:

header(A1) counter(B1)
a =IF(A2<>A1;1;1+B1)
a copy formula seen above
etc

It works! Thank you!
 
B1: =COUNTIF(A:A,A1)

and copy down

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
no problem - of course data stored in first column has to be sorted with
ascendindg or descending mode before copying the formula, and everything can
be done by macro, however task is simple so we can "avoid" a macro ;)
 
A slight modification to your formula in order to produce the numbers the OP
asked for originally...

B1: =COUNTIF($A$1:A1,A1)

...and copy down

Rick
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top