### Title

Using fuctions to add certain quantities

### Post

<!--StartFragment-->Hi,

I am trying to simplify our life at our office. The way we do payroll is totally awful! We need a quick solution to this issue. We have a lot of employees and many of those employees work different positions throughout the pay period. Some positions pay $11 some positions pay $8 and some pay $14, $15 or $16 (this is not including over time). By the time our payroll department has to submit payroll to ADP the person in charge of doing payroll needs to submit all these rates by hand. The method we are currently using is very prone to human error. We are trying to avoid both errors and most important simplify our payroll guru’s life.

I feel that the formulas use on FileMaker Pro are very similar to ones used in Excel. I am a little rusty and I cannot remember which function I need to use to reach my goal.

What I am looking to do is to add a function that will only add certain rates. For example if an employee work 10 days out of the pay period totaling 80hrs, where 4 days (8hrs each day) he worked at $11/hr, 4 days he worked at $16/hr (8hrs each day) and 2 days he worked at $8/hr (8hrs each day). I want a function to tell this new TOTAL HOURS at 11, to ONLY add the total hours this employee worked at $11/hr. Then I want to add another TOTAL HOURS at 8, and I want this cell to ONLY add the total hours this employee worked at $8/hr

I have attached a picture so that you can get a better idea on how we are working with payroll.

Can someone please help me!

Regards,

Ed Alvarez <!--EndFragment-->

<!--EndFragment-->

Edward,

I had a nagging recollection harking back to when I was using FileMaker 2.5, the last version where repeating fields were necessary for this kind of set up that there was a way to selectively sum values in a repeating field.

I did a bit of trial and error and found the following works:

Redefine that calculation field to be: (let's name it cHoursRate10)

If ( HourlyRateField [Get ( CalculationRepetitionNumber ) ] = 10 ; Hours [ Get ( CalculationRepetitionNumber ) ] )

Specify the same number of repetitions for this calculation as you have for the two repeating fields for rate and hours.

And replace the summary field with another calculation field:

Sum ( cHoursRate10)

And it will compute the total of all hours worked at a rate of 10 dollars per hour.

You can then make copies of these fields and just update field names and the precise rate value to get subtotals or the other rates.