Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Basic math with Multiple values in same field

Featured Replies

I'm trying to make basic addition with values in a field.

Field A contains a text of numbers 10,4,2,5

Field B is my calculation field where i want the result of field A. (10+4+2+5)

Sum (Field A) just gives me 10425 instead of 21, and i cant find other functions to solve this.

Any help is appreciated

Edited by JohnDing

First thing: if you need to sum individual values, enter them into separate fields and/or records, not in a single field.

Next, your field does NOT contain "a set of numbers". It contains text. When you attempt to perform a numerical operation on this text, it is converted to a number by extracting the digit characters.

Now, there is a way to sum the values in a comma-separated string: substitute the commas with a "+" character, then use the Evaluate() function on the result. However, if your field contains a trailing comma (as shown in your example), there is an additional complication because: 

10+4+2+5+

is not a valid expression. If the field always contains a trailing comma, you could do:

Evaluate ( Substitute ( Field A ; "," ; "+" ) & "0" )

to get 21.

 

Edited by comment

  • Author

Totally missed Evaluate, that was the missing function. I'm just doing:

Evaluate (Field A)

To get my 21.

The trailing comma was a typo (my bad), and I replaced the commas with "+". 

Will edit my text to contains text instead of numbers.

 

Thanks again Comment

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.