Skip to main content
Question

"

  • Jun 18, 2021 4:07 PM UTC
  • 0 replies
  • 137 views

I'm trying to create a formula to calculate a prize payout.

I'm getting an error at the end with the parenthesis - it says "Expecting bool, number"

I'm not sure what that means. Is anyone available to help? Thank you!

the formula I have now is:

Floor(If([# OF PLAYERS FOR EVENT 06-19]<=4 and [Place]=1,([PRIZE POOL COST]*0.6),
If([# OF PLAYERS FOR EVENT 06-19]<=4 and [Place]=2, ([PRIZE POOL COST]*0.4),

If([# OF PLAYERS FOR EVENT 06-19]<=10 and [# OF PLAYERS FOR EVENT 06-19] >=5 and [Place]=1,([PRIZE POOL COST]*0.4),
If([# OF PLAYERS FOR EVENT 06-19]<=10 and [# OF PLAYERS FOR EVENT 06-19] >=5 and [Place]=2,([PRIZE POOL COST]*0.3),
If([# OF PLAYERS FOR EVENT 06-19]<=10 and [# OF PLAYERS FOR EVENT 06-19]>=5 and [Place]=3,([PRIZE POOL COST]*0.2),
If([# OF PLAYERS FOR EVENT 06-19]<=10 and [# OF PLAYERS FOR EVENT 06-19]>=5 and [Place]=4,([PRIZE POOL COST]*0.1),

If([# OF PLAYERS FOR EVENT 06-19]<=15 and [# OF PLAYERS FOR EVENT 06-19] >=11 and [Place]=1,([PRIZE POOL COST]*0.3),
If([# OF PLAYERS FOR EVENT 06-19]<=15 and [# OF PLAYERS FOR EVENT 06-19] >=11 and [Place]=2,([PRIZE POOL COST]*0.25),
If([# OF PLAYERS FOR EVENT 06-19]<=15 and [# OF PLAYERS FOR EVENT 06-19] >=11 and [Place]=3,([PRIZE POOL COST]*0.2),
If([# OF PLAYERS FOR EVENT 06-19]<=15 and [# OF PLAYERS FOR EVENT 06-19] >=11 and [Place]=4,([PRIZE POOL COST]*0.15),
If([# OF PLAYERS FOR EVENT 06-19]<=15 and [# OF PLAYERS FOR EVENT 06-19] >=11 and [Place]=5,([PRIZE POOL COST]*0.1),

If([# OF PLAYERS FOR EVENT 06-19]<=20 and [# OF PLAYERS FOR EVENT 06-19] >=16 and [Place]=1,([PRIZE POOL COST]*0.29),
If([# OF PLAYERS FOR EVENT 06-19]<=20 and [# OF PLAYERS FOR EVENT 06-19] >=16 and [Place]=2,([PRIZE POOL COST]*0.24),
If([# OF PLAYERS FOR EVENT 06-19]<=20 and [# OF PLAYERS FOR EVENT 06-19] >=16 and [Place]=3,([PRIZE POOL COST]*0.19),
If([# OF PLAYERS FOR EVENT 06-19]<=20 and [# OF PLAYERS FOR EVENT 06-19]>=16 and [Place]=4,([PRIZE POOL COST]*0.14),
If([# OF PLAYERS FOR EVENT 06-19]<=20 and [# OF PLAYERS FOR EVENT 06-19] >=16 and [Place]=5,([PRIZE POOL COST]*0.09),
If([# OF PLAYERS FOR EVENT 06-19]<=20 and [# OF PLAYERS FOR EVENT 06-19] >=16 and [Place]=6,([PRIZE POOL COST]*0.05),

)))))))))))))))))))))))



------------------------------
Renee Hansen
------------------------------
This topic has been closed for replies.

  • Qrew Colonel
  • Jun 18, 2021 5:26 PM UTC
What type of field is your formula field? Numeric? What about the other fields that are used inside your formula, what type are they?

Also you can remove most of those if statements in your formula. You only need the first one. If Quickbase does not get a match in the first part of your formula it continue down the line to the next part. It finishes when it finds the first match and does not continue further. So if Condition 1 was correct it wouldn't even bother checking condition 2 in the below formula, if condition 1 was incorrect it would continue to condition 2.

If(
[Condition 1] = "whatever", "do this",
[Condition 2] = "something else", "do that"
)