Autonumbering of Children Items

Hi,
I have a sheet that has a number of parent items, and each parent has a list of its own children, this sheet also has a Number column. At the moment the use has to fill in the number automatically (i.e. 1,2,3, etc).
I wanted to have a column formula where any task added as a child task for a particular parent task will be numbered at an increment of 1.
Something like:
=IF(HAS([Description]@Row, PARENT()), Parent([No])+1, "")
Issues are:
- This is unparseable
- That would only work for the first child item, but not for the remaining
Any ideas would help.
Thank you.
Answers
-
I've done this before with a lot of helper columns. If somebody has discovered a more efficient method, please do share! Create the columns in the order below:
- "AutoNum" = create an # Auto Numbered column
- "UniqueID" =IFERROR(Primary@row + AutoNum@row, "")
- "ParentID" =IF(COUNT(ANCESTORS()) = 0, "Top", "R" + PARENT(AutoNum@row))
- "Child#" =MATCH(UniqueID@row, COLLECT(UniqueID:UniqueID, ParentID:ParentID, ParentID@row), 0)
The "Child#" field will then auto-calculate what number child it is, no matter how many levels of parent/children you could put on the sheet.
-
Hi, @Jason Tarpinian; this works great. Is there a way to now create a column that will combine the Parent number with the Child taking into account the level?
As an Example, in my screenshot below. In my combined parent/child# column. For row 14, I want it to say 12.2, and for row 15, I want it to say 12.2.1.
I was playing around with this formula, but it isn't right:
=IF(ParentID@row <> "TOP", AutoNum@row + "." + [Child#]@row, "")
Help Article Resources
Categories
Check out the Formula Handbook template!