
www.Usenet.com
| <-- __Chronological__ --> | <-- __Thread__ --> |
So what are you using? Lotus 123 Release 9.0 or higher? If so, @LARGE, @COUNTIF and @SUM would be all you needed. If the original column of data were named LIST, use these formulas beginning in cell C1.
C1: @LARGE($LIST,1) [or @MAX($LIST)]
D1: @COUNTIF($LIST,C1)
C2: @LARGE($LIST,@SUM(D$1..D1,1))
D2: @COUNTIF($LIST,C2)
Copy C2..D2 and paste in cells below as far down as needed. The formulas will return ERR when the original data has been exhausted.
If you're not even using a spreadsheet, does your programming language provide associative arrays? If so, maybe you could adapt this awk script.
!($1 in c) { ++n
for (i = 1; i <= n; ++i) {
if ($1 > d[i] && s == "") {
s = d[i] d[i] = $1
} else if (s != "") {
t = d[i] d[i] = s s = t
} else if (i == n) {
d[i] = $1
} #end if
} #end for
s = ""
} #end action for pattern !($1 in c)
{ ++c[$1] }
END { for (i = 1; i <= n; ++i) printf("%8g %4d\n", d[i], c[d[i]]) }
-- Never attach files. Snip unnecessary quoted text. Never multipost (though crossposting is usually OK). Don't change subject lines because it corrupts Google newsgroup archives.
| <-- __Chronological__ --> | <-- __Thread__ --> |