The hard way:
If you know the maximum number of elements in the list, build a series
of summing statements...
L1+L2+L3+...+Ln (n=max)
L1+L2+L3+...+L(n-1)
L1+L2+L3+...+L(n-2)
and so on until
L1+L2
Test for the number of elements and use the appropriate statement.
The easy way:
Get the Formula1 Toolkit which has the ability to sum the numbers in a
list.
---------------------
I've done both. The second method is a LOT quicker :)
-- Bob
Notes Release 4 has an @Sum function.
Chris
--------------------------------------------------------------------------
csf...@undergrad.math.uwaterloo.ca
Chris_Fales%C...@NotesGW.CompuServe.com
Here's my @Sum formula. Here are the limits:
The maximum number of numbers a single field will hold is 8111.
The maximum number of numbers @Sum will add is 8154 (achieved by
joining two list fields).
The R4 @Sum function has the same limits.
Place your number list in a variable called values.
f := @Power(2; @Integer(@Log(@Elements(values)) / @Log(2)));
adjust := @Elements(values) - f;
list := @If(adjust = 0; values; (@Subset(values; adjust) +
@Subset(values; -adjust)) : @Subset(@Subset(values; f); adjust - f));
@If(f > 1; @Set("f"; f / 2) + @Set("list"; @Subset(list; f) +
@Subset(list; -f)) ; "" );
@If(f > 1; @Set("f"; f / 2) + @Set("list"; @Subset(list; f) +
@Subset(list; -f)) ; "" );
@If(f > 1; @Set("f"; f / 2) + @Set("list"; @Subset(list; f) +
@Subset(list; -f)) ; "" );
@If(f > 1; @Set("f"; f / 2) + @Set("list"; @Subset(list; f) +
@Subset(list; -f)) ; "" );
@If(f > 1; @Set("f"; f / 2) + @Set("list"; @Subset(list; f) +
@Subset(list; -f)) ; "" );
@If(f > 1; @Set("f"; f / 2) + @Set("list"; @Subset(list; f) +
@Subset(list; -f)) ; "" );
@If(f > 1; @Set("f"; f / 2) + @Set("list"; @Subset(list; f) +
@Subset(list; -f)) ; "" );
@If(f > 1; @Set("f"; f / 2) + @Set("list"; @Subset(list; f) +
@Subset(list; -f)) ; "" );
@If(f > 1; @Set("f"; f / 2) + @Set("list"; @Subset(list; f) +
@Subset(list; -f)) ; "" );
@If(f > 1; @Set("f"; f / 2) + @Set("list"; @Subset(list; f) +
@Subset(list; -f)) ; "" );
@If(f > 1; @Set("f"; f / 2) + @Set("list"; @Subset(list; f) +
@Subset(list; -f)) ; "" );
@If(f > 1; @Set("f"; f / 2) + @Set("list"; @Subset(list; f) +
@Subset(list; -f)) ; "" );
list
Copyright 1993 MFJ International
This formula is the intellectual property of MFJ International. It
may be used freely as long as this notice is posted with it.