Brian Dunning's FileMaker Custom Functions

SUMLIST ( list )

sums the numbers in a list

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

Martin Spanjaard   Martin Spanjaard - Show more from this author
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!
 
Kyle Williams   Kyle Williams, Augusto Digital
Jan 13, 2021
There is now a conflict with the List function, had to change the parameter from "list" to "_list". I suppose that "theList" would also work. Thank you for this function, works like a dream!
 

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.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 20 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: