I have an excel sheet or a table which looks like following(3 columns or field),
Part-----Assembly----Avg
5------- 12.5------- 15
4------- 20--------- 5
2------- 35--------- 30
1------- 14--------- 16
3------- 18--------- 21
(It is an example, May be I will have thousands of records)
This data is collected from simulation run (do not bother).
Now what I want is the following,
First, Find the smallest number from 2 columns (Assembly and Avg),
For example, here the smallest number is 5, which is in Avg column.
Second If the smallest number found in Column (Avg) than place the entire
record at the beginning of the table, or if the smallest number found in column(Assembly ) than place the entire record at the end of the table.
Note: You can use another table or excel sheet to insert the sorted record or the same sheet or table.
Therefore, from the above table we get the following,
Part-----Assembly----Avg
4------- 20----------- 5
2------- 35------------ 30
3------- 18------------ 21
1------- 14------------ 16
5------- 12.5-----------15
Therefore, the prime thing is to find the smallest number first and place the record on table according to the columns (Assembly, Avg) and to keep in mind that after each search the found number must be eliminated to find the next smallest. The whole process should run at once.
I have no idea about it how to place record on a table according to above requirement.
Please provide me some solution for that.
You can write code for Excel macro (VBA) or visual basic coding or SQL query. Any of the form would be accepted. I just need the logic to do this.
Part-----Assembly----Avg
5------- 12.5------- 15
4------- 20--------- 5
2------- 35--------- 30
1------- 14--------- 16
3------- 18--------- 21
(It is an example, May be I will have thousands of records)
This data is collected from simulation run (do not bother).
Now what I want is the following,
First, Find the smallest number from 2 columns (Assembly and Avg),
For example, here the smallest number is 5, which is in Avg column.
Second If the smallest number found in Column (Avg) than place the entire
record at the beginning of the table, or if the smallest number found in column(Assembly ) than place the entire record at the end of the table.
Note: You can use another table or excel sheet to insert the sorted record or the same sheet or table.
Therefore, from the above table we get the following,
Part-----Assembly----Avg
4------- 20----------- 5
2------- 35------------ 30
3------- 18------------ 21
1------- 14------------ 16
5------- 12.5-----------15
Therefore, the prime thing is to find the smallest number first and place the record on table according to the columns (Assembly, Avg) and to keep in mind that after each search the found number must be eliminated to find the next smallest. The whole process should run at once.
I have no idea about it how to place record on a table according to above requirement.
Please provide me some solution for that.
You can write code for Excel macro (VBA) or visual basic coding or SQL query. Any of the form would be accepted. I just need the logic to do this.
Comment