#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 153
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sorting Values Without Sorting Formulas SBX Excel Discussion (Misc queries) 2 April 12th 09 11:17 PM
Automatic sorting (giving max and min) based on custom sorting lis Joe Lewis[_2_] Excel Worksheet Functions 4 November 23rd 08 05:12 AM
Sorting VLookup vs Sorting SumProduct Lauren Excel Discussion (Misc queries) 1 August 21st 07 12:19 AM
Sorting: Sorting by the First Character dzuy Excel Discussion (Misc queries) 2 June 22nd 06 08:27 PM
Sorting ListBox results or transposing ListBox values to other cells for sorting Rob[_8_] Excel Programming 1 July 9th 03 04:35 AM


All times are GMT +1. The time now is 07:58 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"