Usenet.com

www.Usenet.com

Group Index

Comp Thread Archive from Usenet.com

<-- __Chronological__ --> <-- __Thread__ -->

Re: Help needed with analysing a column of data



Thank you, that's brilliant! I'm using Quattro Pro 9. I found the @LARGEST function but that's a neat trick to get round the problem of @LARGEST returning duplicates.

Nigel

Harlan Grove wrote:


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__ -->


Usenet.com



Please check out one of the premium Usenet Newsgroup Service Providers below for access to Usenet.