Brian Dunning's FileMaker Custom Functions

SUMLIST ( list )

sums the numbers in a list

  Average rating: 3.9 (38 votes) Log in to vote

Martin Spanjaard   Martin Spanjaard
Trias Digitaal
http://www.triasdigitaal.nl

Share on Facebook Share on Twitter

  Sample input:
SUMLIST ( 2.5¶3 )
  Sample output:
5.5

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

Adds the numbers in a list. We use it on our invoices, where the user is free to put the amounts in a text field.

It recursively takes the first number off the list and adds it to the rest of the list, till the list is empty.

Formatting is done recursively by two other custom functions.

 

Comments

unin   unin, japan
Feb 8, 2010
Evaluate(Substitute(list;¶;"+"))
 
Bart Bartholomay   Bart Bartholomay, Vero Beach, FL
Feb 9, 2010
Why not:

Sum(thelist)
 
Martin Sorich   Martin Sorich, San Jose, CA
May 14, 2010
@unin

Clever, but in FMP 10, 11 extra "+" is appended to end of string which does not evaluate properly. I suggest:

Evaluate( Left( Substitute (list;¶;"+") ; Length ( list ) -1 ) )

@Bart

List is delimited by ¶ and Sum function does not work.
 
Tom Fitch   Tom Fitch
May 25, 2011
@Martin - There's nothing inherently wrong with unin's function, it just assumes a proper list. It's the LeftValues and RightValues functions that are appending the carriage return.

@unin - That is so cool!
 

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Under construction. Email me your wish list for improvements.