4 Replies Latest reply on Jul 11, 2014 2:09 AM by raybaudi

# How to get total of numbers in a textbox

### Title

How to get total of numbers in a textbox

### Post

Hi,

Can you help me with a function to sum up the total numerical values in a textbox separated by , or carriage return e.g.

If text contained "XS-1000, S-2000, M-3000" what kind of calculation to use to output a value of 6000?

I tried and I am stuck at.

Let(I=PatternCount(text; ",") + 1; Filter(LeftValues(text; i); "1234567890"); i = i -1)

but it only outputs 100020003000

I appreciate your time and help, thank you.

• ###### 1. Re: How to get total of numbers in a textbox

I would think something using GetValue and/or GetAsNumber and some form of Evaluate( Substitute( text; ¶; "+" ) ) might be worth a look.

• ###### 2. Re: How to get total of numbers in a textbox

Maybe run what you have with slight change to hold the "," in there and then add "," to the filter and then use Evaluate( Substitute( text; ","; "+" ) ).

• ###### 3. Re: How to get total of numbers in a textbox

create a list from those text fields (replacing ',' by a FileMaker Return character), filter elements as in Your example -> and use a custom function for adding the values.

www briandunning com, ie SUMLIST(list) by Martin Spanjaard

• ###### 4. Re: How to get total of numbers in a textbox

"Can you help me with a function to sum up the total numerical values in a textbox separated by ,"

Evaluate ( "Abs ( \"" & Substitute ( YourTextField ; ", " ; "\" ) + Abs ( \"" )  & "\" )" )