Hi Experts,

I need to generate unique number as per the following format...

This Unique Number comprises of 4 sections.

Suppose, Number is

**"E17100007"** (which is unique)

1.

**E** is first character from Column B

2.

**17** is 2 digit Year from Date Column (C)

3.

**10** is 2 digit Month from Date Column (C)

4.

**0007** is four digit number which will grow by 1 within its group. (Consider that this number does not exceed 9999 limit)

Where group is

**'E1710'** and number will be get incremented but if group changes then it will start from 0001.

When I use this formula it reset all the numbers falls after it.

It should not be actually.

It should first find out the maximum and and then increment. All the previously generated numbers should intact.

How to achieve the task? (If it is VBA than it will be better)

Sample file is attached?

Regards,

D Patel

UniqueNumber.xlsx
Open in new window

It does work for me, though I have it in column G, not D or E.

As for being able to insert rows in the middle of your data and having the formulas not recalculate, that is not possible. Every time you insert data they will all recalculate and update all the numbers below. If you don't want them to change then once you have your numbers then you will have to do a copy/paste values so that it is just a value and not a formula. Then you can do an insert, but my code will not take into account anything below it for generating the unique numbers.