Forum Discussion

AshleySolomon's avatar
AshleySolomon
Qrew Trainee
12 months ago
Solved

Total Formula with 2 IF statements

I that a Total field that needs to...

1st look at a Manual entry field and pull the value it if it is populated. Caveat, if 0 is entered in the Manual field then the Total needs to be 0. So I have taken the "treat blanks as 0" off the Manual field.

2nd if there is NOT a value in the Manual field, and Charge Filing Fee is Checked then apply Filling Fee to the Total. 

IF Charge Filing Fee is not checked then the Total is 0. 

Below is my current formula. The piece that I can figure out is if 0 is entered into the Manual field.

If([Filing Fees - Manual]<>0, [Filing Fees - Manual], If([Fee Schedule - Charge Filing Fee?]=true, [Fee Schedule - Filing Fees (per Filing)],0))



------------------------------
Ashley Solomon
------------------------------
  • There are a few ways to do this, but one thing to know is Quickbase will read a formula from top down and stop as soon as it hits a true statement. We can use this to our advantage. Below should work, assuming that only one of the 3 conditions below will be true at once OR assuming we have written it top down in order of importance (ie the formula can stop and return a value as soon as it hits the first true statement).

    If(
      [Filing Fees - Manual]=0,0,
      [Filing Fees - Manual]<>0, [Filing Fees - Manual],
      isnull([Filing Fees-  Manual]) and [Fee Schedule - Charge Filing Fee?]=true, [Fee Schedule - Filing Fees (per Filing)],
    [Fee Schedule - Charge Filing Fee?]=false,  0
     )



    ------------------------------
    Mike Tamoush
    ------------------------------

2 Replies

  • There are a few ways to do this, but one thing to know is Quickbase will read a formula from top down and stop as soon as it hits a true statement. We can use this to our advantage. Below should work, assuming that only one of the 3 conditions below will be true at once OR assuming we have written it top down in order of importance (ie the formula can stop and return a value as soon as it hits the first true statement).

    If(
      [Filing Fees - Manual]=0,0,
      [Filing Fees - Manual]<>0, [Filing Fees - Manual],
      isnull([Filing Fees-  Manual]) and [Fee Schedule - Charge Filing Fee?]=true, [Fee Schedule - Filing Fees (per Filing)],
    [Fee Schedule - Charge Filing Fee?]=false,  0
     )



    ------------------------------
    Mike Tamoush
    ------------------------------

    • AshleySolomon's avatar
      AshleySolomon
      Qrew Trainee

      Awesome! That did the trick. Thanks Mike.



      ------------------------------
      Ashley Solomon
      ------------------------------