Skip to main content
Solved

Looking for help writing formula for pay earned based on variable

  • August 29, 2020
  • 3 replies
  • 35 views

I’m looking for help writing a formula to show what pay a staff member has earned based on a variable.

I have hours worked (at 30 per hour for one role, and 25 for a different role), and trainings complete at 50 per session.

How do I write a formula that looks at the “role assigned select field” and calculates based on the correct rate of pay?

Thanks,

Best answer by JonathanBowen

Hi @Ryan_Anderson1 - you can do something like this:

IF({Role Field} = 'Role 1', {Hours field} * 30, {Hours field * 25})

and then to include the trainings you can extend this with:

IF({Role Field} = 'Role 1', {Hours field} * 30, {Hours field * 25}) + {trainings complete field} * 50

For 2 roles, an IF statement is fine. If you end up with more than this, you can move to SWITCH statement, which is often easier than multiple nested IFs

3 replies

JonathanBowen
Forum|alt.badge.img+18
  • Inspiring
  • Answer
  • August 29, 2020

Hi @Ryan_Anderson1 - you can do something like this:

IF({Role Field} = 'Role 1', {Hours field} * 30, {Hours field * 25})

and then to include the trainings you can extend this with:

IF({Role Field} = 'Role 1', {Hours field} * 30, {Hours field * 25}) + {trainings complete field} * 50

For 2 roles, an IF statement is fine. If you end up with more than this, you can move to SWITCH statement, which is often easier than multiple nested IFs


  • Author
  • New Participant
  • August 29, 2020

Hi @Ryan_Anderson1 - you can do something like this:

IF({Role Field} = 'Role 1', {Hours field} * 30, {Hours field * 25})

and then to include the trainings you can extend this with:

IF({Role Field} = 'Role 1', {Hours field} * 30, {Hours field * 25}) + {trainings complete field} * 50

For 2 roles, an IF statement is fine. If you end up with more than this, you can move to SWITCH statement, which is often easier than multiple nested IFs


Thank you! I’ll start there and see if I have any issues, thank you!


JonathanBowen
Forum|alt.badge.img+18

Thank you! I’ll start there and see if I have any issues, thank you!


This isn’t correct - should be:

{Hours field} * 25