Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Help! i have spent many hours poring over this so i hope somebody out
there has some ideas: I have some data which kind of looks like the following in it's simplest form: LEVEL ID INSTRUMENT DEVIATION 1 0 Entry Structure 100 2 0 Beverages 20 3 1 Allied Domecq 8 3 2 Diageo 2 3 3 Scottish Newcastle 10 2 0 Mining 30 3 4 GOC 10 3 5 Rio Tinto 20 The data is stored in an array let's say in this example: varData(8, 4) (8 rows, 4 columns) I am trying to develop an algorithm to sort the data by DEVIATION in hierarchical order - that is, sort everything at level 1 first, then 2, then 3. Once sorted the data will look like this: 1 0 Entry Structure 100 2 0 Mining 30 3 5 Rio Tinto 20 3 4 GOC 10 2 0 Beverages 20 3 3 Scottish Newcastle 10 3 1 Allied Domecq 8 3 2 Diageo 2 It looks simple enough but once you start working on it you end up going around in circles and then get confused/frustrated/give up/go mad. I'm working with much more levels than this and it's not nice. Anyone help? I'm slowly going insane............ |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If I sort on Deviation within Level, then all the levels should be together
like this: LEVEL ID INSTRUMENTATION DEVIATION DUM 1 0 Entry Structure 100 1 2 0 Mining 30 6 2 0 Beverages 20 2 3 5 Rio Tinto 20 8 3 3 Scottish Newcastle 10 5 3 4 GOC 10 7 3 1 Allied Domecq 8 3 3 2 Diageo 2 4 but you don't show that as your result You have level 2 Beverages mixed in with Leve 3. Could you state a little more clearly what you want to do. -- Regards, Tom Ogilvy "Karen Lee" wrote in message om... Help! i have spent many hours poring over this so i hope somebody out there has some ideas: I have some data which kind of looks like the following in it's simplest form: LEVEL ID INSTRUMENT DEVIATION 1 0 Entry Structure 100 2 0 Beverages 20 3 1 Allied Domecq 8 3 2 Diageo 2 3 3 Scottish Newcastle 10 2 0 Mining 30 3 4 GOC 10 3 5 Rio Tinto 20 The data is stored in an array let's say in this example: varData(8, 4) (8 rows, 4 columns) I am trying to develop an algorithm to sort the data by DEVIATION in hierarchical order - that is, sort everything at level 1 first, then 2, then 3. Once sorted the data will look like this: 1 0 Entry Structure 100 2 0 Mining 30 3 5 Rio Tinto 20 3 4 GOC 10 2 0 Beverages 20 3 3 Scottish Newcastle 10 3 1 Allied Domecq 8 3 2 Diageo 2 It looks simple enough but once you start working on it you end up going around in circles and then get confused/frustrated/give up/go mad. I'm working with much more levels than this and it's not nice. Anyone help? I'm slowly going insane............ |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
We are not sorting solely by deviation. Rows are related like a 'tree'
structure and level hierarchy from the original data must be maintained. It might help if I show the data like this: 1 0 Entry Structure 100 2 0 Beverages 20 3 1 Allied Domecq 8 3 2 Diageo 2 3 3 Scottish Newcastle 10 2 0 Mining 30 3 4 GOC 10 3 5 Rio Tinto 20 - Level 1 acts as the root and is the umbrella for everything - it is always at the top. - At level 2 Beverages and Mining act as group headers for everything underneath (which are the level 3s). So instruments 1, 2 and 3 must always be under Beverages and instruments 4 and 5 under Mining. - The level 2s are sorted first, including everything underneath: 1 0 Entry Structure 100 2 0 Mining 30 3 4 GOC 10 3 5 Rio Tinto 20 2 0 Beverages 20 3 1 Allied Domecq 8 3 2 Diageo 2 3 3 Scottish Newcastle 10 - Then we sort the level 3 instruments to give the finished product: 1 0 Entry Structure 100 2 0 Mining 30 3 5 Rio Tinto 20 3 4 GOC 10 2 0 Beverages 20 3 3 Scottish Newcastle 10 3 1 Allied Domecq 8 3 2 Diageo 2 Rgds, K *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Postcode structure for data validation | Excel Discussion (Misc queries) | |||
Does structure of data affect speed of vlookup? | Excel Worksheet Functions | |||
how do I put the symbol of structure above data | Excel Discussion (Misc queries) | |||
how do I put the symbol of structure above data | Excel Discussion (Misc queries) | |||
data structure and my problem | Excel Worksheet Functions |