Formula to create custom Autonumber

neo_gold

New Member
Joined
Sep 22, 2013
Messages
3
Hello All,
I need some help in creating a custom autonumber in excel. The autonumber will be based on the value of another cell's value. So for eg, in cell A1 will look at B1, if B1 has the number 1, A1 will take B1 and add the autonumber to it, eg a, b, c.
If within, b5 the number is 2. So if the number in the corresponding row in b changes, the autonumber must restart.

Ive decided to go with a-z for the autonumber as i realized for .1, .2, .3 is limited to 9 values in the list bec. 1.10 may be read as 1.1
I've tried a few options such as creating a named range, however the problem is getting the autonumber to restart. Below is what i want to achieve via excel formula (not vba please)
Column FColumn F
1.a1
1.b1
2.a2
2.b2
3.c2
3.a3

<tbody>
</tbody>

Thank you in advance!
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
AutoNumberValue
1.a1
1.b1
2.a2
2.b2
2.c2
3.a3

<COLGROUP><COL style="WIDTH: 85pt; mso-width-source: userset; mso-width-alt: 4039" width=114><COL style="WIDTH: 48pt" width=64><TBODY>
</TBODY>

=B2&"."&CHAR(96+COUNTIF($B$2:B2,B2))
 
Upvote 0
wow thanks Aladin!
One thing, when I tested the last value has the value of "`" so i changed the value from B2 to B1 throughout the formula and its good now (for the first cell A1). I assume u just happened to copy the formula from cell B instead of A.
Just for my knowledge and others, the formula is saying: take the value of B1 and count within that column range the number of times B1 exists. For each time it exists, add one to the character count. The character count starts at a, so that gives it the autonumbering. If its the first time its found in the range, it resets counting from A...
 
Upvote 0
wow thanks Aladin!

You are welcome.

One thing, when I tested the last value has the value of "`" so i changed the value from B2 to B1 throughout the formula and its good now (for the first cell A1). I assume u just happened to copy the formula from cell B instead of A.
Just for my knowledge and others, the formula is saying: take the value of B1 and count within that column range the number of times B1 exists. For each time it exists, add one to the character count. The character count starts at a, so that gives it the autonumbering. If its the first time its found in the range, it resets counting from A...

If you don't have headers and autonumbering takes place in column A depending on the values in column B, we would have:

=B1&"."&CHAR(96+COUNTIF($B$1:B1,B1))

This says: Concatenate B1 with the char obtained from B1's current occurrence frequency (done with a progressive countif) which is added to 96 for 96 + 1 --> 97 --> a; 96 + 2 --> 98 --> b; and so on. When B1 changes to a diffrent value, the concatenated result changes accordingly.
 
Upvote 0

Forum statistics

Threads
1,215,220
Messages
6,123,693
Members
449,117
Latest member
Aaagu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top