I have a spreadsheet with requirements for a project, and there are two columns that I need to determine the sorting. First column (Req #) is often a parent to the child column (Parent Req #). See images for more details. I'll have rows that don't have a parent req #, but when they do, I'd like those records "inserted" between the parent, and the next numerically sorted rows.
To illustrate, here's a before / after sort that I'd like to accomplish:
In the second half (sorted), notice that I've changed the indenting to better communicate which rows are children to preceding rows. The indentation is not needed as part of the solution.
Can you see how ITEM-3 immediately follows ITEM-2? ITEM-9 follows ITEM-3 (because it's a child of ITEM-3), and ITEM-8 follows ITEM-9 (because it's a child of ITEM-2, and there are no more ITEM-3 children).
Note: I've already tried doing this with the advanced sorting dialog, and it didn't seem to work. I'm guessing I need to look into a custom sort column, but I'm stuck as to how to write the formula for what I'm trying to do.
Any suggestions?
To illustrate, here's a before / after sort that I'd like to accomplish:
In the second half (sorted), notice that I've changed the indenting to better communicate which rows are children to preceding rows. The indentation is not needed as part of the solution.
Can you see how ITEM-3 immediately follows ITEM-2? ITEM-9 follows ITEM-3 (because it's a child of ITEM-3), and ITEM-8 follows ITEM-9 (because it's a child of ITEM-2, and there are no more ITEM-3 children).
Note: I've already tried doing this with the advanced sorting dialog, and it didn't seem to work. I'm guessing I need to look into a custom sort column, but I'm stuck as to how to write the formula for what I'm trying to do.
Any suggestions?