Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sorting
Hi everyone,
Sorry, I can't seem to get the columns to line up in the post. I'm maintaining a family tree with a spreadsheet, basic components consist of name and generation index. | Grandfather's sibling | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | | Grandfather | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | | Son #1 | 2 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | | Grandson 1- 1 | 2 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | | Grandson 1-2 | 2 | 1 | 2 | 0 | 0 | 0 | 0 | 0 | | Son #2 | 2 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | | Grandson 2-1 | 2 | 2 | 1 | 0 | 0 | 0 | 0 | 0 | | Grandson 2-1-1 | 2 | 2 | 1 | 1 | 0 | 0 | 0 | 0 | | Grandson 2-2 | 2 | 2 | 2 | 0 | 0 | 0 | 0 | 0 | | Grandfather's sibling | 3 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | etc. Sometimes it's handy to have all the siblings in a generation grouped together like this: | Grandfather's sibling | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | | Grandfather | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | | Grandfather's sibling | 3 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | | Son #1 | 2 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | | Son #2 | 2 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | | Grandson 1-1 | 2 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | | Grandson 1-2 | 2 | 1 | 2 | 0 | 0 | 0 | 0 | 0 | | Grandson 2-1 | 2 | 2 | 1 | 0 | 0 | 0 | 0 | 0 | | Grandson 2-2 | 2 | 2 | 2 | 0 | 0 | 0 | 0 | 0 | | Grandson 2-1-1 | 2 | 2 | 1 | 1 | 0 | 0 | 0 | 0 | This one has me stumped, and I've got myself in a rut thinking about it. As a workaround, I have a routine that builds a secondary index, which will produce the desired result using "normal" sorting. Basically, it's a copy of the regular index, with all the non-zero digits shifted to the extreme right. | Grandfather's sibling | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | | Grandfather | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | | Son #1 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 1 | | Grandson 1- 1 | 0 | 0 | 0 | 0 | 0 | 2 | 1 | 1 | | Grandson 1-2 | 0 | 0 | 0 | 0 | 0 | 2 | 1 | 2 | | Son #2 | 0 | 0 | 0 | 0 | 0 | 2 | 2 | 0 | | Grandson 2-1 | 0 | 0 | 0 | 0 | 0 | 2 | 2 | 1 | | Grandson 2-1-1 | 0 | 0 | 0 | 0 | 2 | 2 | 1 | 1 | | Grandson 2-2 | 0 | 0 | 0 | 0 | 0 | 2 | 2 | 2 | | Grandfather's sibling | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 | While this does work, it seems like a clumsy method, as well as adding a lot of data to an already large file. One idea I had was to combine each persons index into one integer, and shift it with some simple math, but the fact that some of the older generations had more than 9 kids complicated things. If anyone has any ideas, I would be glad to hear them. Thanks, DaveU |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Sorting Values Without Sorting Formulas | Excel Discussion (Misc queries) | |||
Automatic sorting (giving max and min) based on custom sorting lis | Excel Worksheet Functions | |||
Sorting VLookup vs Sorting SumProduct | Excel Discussion (Misc queries) | |||
Sorting: Sorting by the First Character | Excel Discussion (Misc queries) | |||
Sorting ListBox results or transposing ListBox values to other cells for sorting | Excel Programming |