sort an array

  • Thread starter Thread starter clui
  • Start date Start date
C

clui

What's the code for sorting an array? For example, my array looks lik
this: <20, <5, <60, <9. I want to have it in this order: <5, <9, <20
<60.

Thanks
 
your values appear to be text. Text would sort as

<20
<5
<60
<9

If you want a numberical sort, you could insert a column next to your data
and use a formula like

=--(Right(A1,Len(A1)-1) [drag fill down the column]

Then sort both columns using the column with the formulas as the sort key.
 
Further to the answer below i am not quite clear how that answer sorts
an array. It appears to sort a range.

I have a similar problem:

How do i sort an array which contains 7 columns and 1,000,000 rows of
numeric data.
I bascially need to re-order the rows in ascending order based on the
value of the final column in the row.

eg.
1,1,2,3,4,6,99.78
2,3,4,5,6,1,12.34
2,1,3,4,2,2,10000.56
...

to give:
2,3,4,5,6,1,12.34
1,1,2,3,4,6,99.78
2,1,3,4,2,2,10000.56
...

How do i then take the top 50 rows into excel and delete the rest?

Thanks

N
 
Back
Top