Create a unique number list

bristolrob

New Member
Joined
Apr 23, 2018
Messages
34
Ok so here is what I am after if anyone can help
I need to create a unique number from an item list, I am given indent numbers on the list for parent/child relationships
top level is level zero which is 001, next level with an indent of 1 will be 001001, next level with an indent of 2 will be 001001001, there may be a second indent of 2 under that giving you 001001002, and again there could be a 3rd,4th,5th indent of 2 underneath that giving you 001001005, this may go to up to 10 indents, the indents will always go up in sequence before possibly going back down in sequence Or back to level 1 again, so the indents might go 1,2,3,4,5,4,3 then jump back to 1,2,3,2,3,3,2 etc and then back to 1 again, and so on and so on down the item list.
This may be upwards of 20k items for an engine or vehicle etc.
The only way i have of doing this at the moment is manually which is extremely time consuming.
Any advice or help will be gratefully received.
Rob
Example below
A previous formula offered to solve this went up the list in correct sequence, but did not address going back down the list
(MY fault not the fault of the solution offered, many thanks to Peter_SSs)

INDENTUnique number
0001
1001001
2001001001
2001001002
2001001003
1001002
2001002001
2001002002
2001002003
1001003
2001003001
2001003002
2001003003
2001003004
2001003005
2001003006
2001003007
2001003008
1001004
2001004001
2001004002
2001004003
2001004004
2001004005
2001004006
2001004007
3001004007001
3001004007002
4001004007002001
3001004007003
2001004008
1001005
2001005001
3001005001001
2001005002
3001005002001
1001006

<tbody>
</tbody>
 
.. it is also not returning the leading 2 zero's
The formula still returns leading zeros for me. The only way I have been able to reproduce what you are showing in this regard is to copy the results and paste as values and then use the error-checking option to "convert numbers stored as text to numbers"



.. it is now for some reason not going back to the required level when going down i.e from 4 to 2 ...
The formula never did account for that. As with your previous thread on the same topic, it appears that you have given specific specifications of what can happen, but then subsequently change those specifications. :(

In this case, you specifically stated that if the indents went down, they would either go down sequentially or straight down to 1, not any other amount like from 4 to 2.
.. the indents will always go up in sequence before possibly going back down in sequence Or back to level 1 again, so the indents might go 1,2,3,4,5,4,3 then jump back to 1,2,3,2,3,3,2 etc
 
Last edited:
Upvote 0

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Okay, given that the indents can ..
a) Increase incrementally, or
b) Decrease by any amount
.. try this version.

Excel Workbook
AB
1INDENTUnique number
20001
31001001
41001002
52001002001
63001002001001
73001002001002
83001002001003
93001002001004
103001002001005
112001002002
123001002002001
134001002002001001
144001002002001002
154001002002001003
164001002002001004
172001002003
182001002004
193001002004001
204001002004001001
214001002004001002
224001002004001003
234001002004001004
244001002004001005
254001002004001006
264001002004001007
274001002004001008
284001002004001009
291001003
301001004
311001005
321001006
Unique Num (4)
 
Upvote 0
Actually, this much simpler one seems to also do the job.

Excel Workbook
AB
1INDENTUnique Number
20001
31001001
41001002
52001002001
63001002001001
73001002001002
83001002001003
93001002001004
103001002001005
112001002002
123001002002001
134001002002001001
144001002002001002
154001002002001003
164001002002001004
172001002003
182001002004
193001002004001
204001002004001001
214001002004001002
224001002004001003
234001002004001004
244001002004001005
254001002004001006
264001002004001007
274001002004001008
284001002004001009
291001003
301001004
311001005
Unique Num (5)
 
Upvote 0

Forum statistics

Threads
1,214,976
Messages
6,122,541
Members
449,089
Latest member
davidcom

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