Forum Discussion

ReneeHansen's avatar
ReneeHansen
Qrew Member
3 years ago

"

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
------------------------------

12 Replies

  • AustinK's avatar
    AustinK
    Qrew Commander
    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"
    )
    • ReneeHansen's avatar
      ReneeHansen
      Qrew Member
      # OF PLAYERS FOR EVENT IS NUMERIC
      PLACE IS TEXT MULTIPLE-CHOICE - IS THIS THE ISSUE?
      THE EVENT PRIZE POOL IS CURRENCY
      PLAYER PRIZE PAYOUT IS FORMULA-NUMERIC​

      ------------------------------
      Renee Hansen
      ------------------------------
      • MarkShnier__You's avatar
        MarkShnier__You
        Icon for Qrew Legend rankQrew Legend
        I also suggest that tyou not nest your IFs, but yes, among the problems that the formula may have is that if the [Place] is a text field, then you will need to test like this

        [Place]="1"


        ------------------------------
        Mark Shnier (YQC)
        Quick Base Solution Provider
        Your Quick Base Coach
        http://QuickBaseCoach.com
        mark.shnier@gmail.com
        ------------------------------