# sumreps ( rfield ; from ; to )

Sums repeating field rep values from rep `from` to `to`

Average rating: 4.6 (25 votes) Log in to vote

Oliver Reid - Show more from this author |

Sample input:

sumreps(field;4;6)

where field is (1,2,3,4,5,6)

where field is (1,2,3,4,5,6)

Sample output:

15

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

Handy function to sum a subset of repeating field reps

## Comments

Matthew Fero, Seattle Dec 31, 2012 |
||

This is exactly what I was looking for. However, the function seemed to be broken until I changed 'rfield' to 'GetFieldName ( rfield )' ... as follows: Let ( [ nn = If ( to ≠ ""; to - from + 1 ; 200) ; xx = Evaluate( "MiddleValues (List (" & GetFieldName ( rfield ) & ");" & from & ";" & nn &")" ); lln = Length (xx) - 1 ; uu = Left (xx ; lln) ] ; Evaluate( Substitute(uu ;¶;"+")) ) |
||

Oliver, Stamford Ct Dec 31, 2012 |
||

rfield should be inserted in quotes actually: I have added a note to clarify that. | ||

Martin, Switzerland May 20, 2013 |
||

Does not work if some of the repetitions are empty | ||

Oliver, CT May 20, 2013 |
||

That's true Martin. I will fix when I figure that out. One could use as an argument that is the Max of the intended rep field and another that contains only 0's |
||

Jim, NY Oct 19, 2014 |
||

Dosent work at all! | ||

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