finding second (third...) largest in a list



Hello,

Is there a variant on MAX() that will return the second (third...) largest element?

I have some 100 rows of data, and I would like to have another set of columns that has the same data but each row (independently) sorted. Ideally, I would also like to have a copy of the column headers sorted according to the data.

eg: if the data looks like this (assuming six columns of data):
  headr_row    1 2 3 4 5 6
  first_row    3 1 4 1 5 9
  secnd_row    2 7 1 8 2 8
  ...

then I would like the next columns to do something like the following
  headr_row    1 2 3 4 5 6
  first_row    3 1 4 1 5 9   1 1 3 4 5 9   2 4 1 3 5 6
  secnd_row    2 7 1 8 2 8   1 2 2 7 8 8   3 1 5 2 4 6
  ...

One way to do this would be do use formulae for the second, third... largest elements, but I can find no such functions.

thanks in advance for any help
mike



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]