Forum Discussion

TonyGonzalez's avatar
TonyGonzalez
Qrew Member
3 months ago

Easy Formula Help

Moving on to my next application.  We keep track of Adobe subscriptions so we can charge the proper departments.  I have the table and such setup, I just need help with the Yearly Cost formula.  I have a bunch of checkbox that can be checked to indicate which subscriptions a user has.  I get a new yearly cost each year that I can use to update the formula.  So  my formula in plain terms, I just don't know formula syntax here yet.  

If field 1 is checked/true, add $1.  If false, add $0.

If field 2 is checked/true, add $2.If false, add $0

and so on.  



------------------------------
Gonzo - A Newbie, but learning fast. (Former SmartSheet evangelist who is quickly converting to QuickBase)
IT Director City of New Braunfels
------------------------------

6 Replies

  • MarkShnier__You's avatar
    MarkShnier__You
    Qrew #1 Challenger

       IF([field 1], 1,0)

    +IF([field 2], 2,0)

    +IF([field 3], 5,0)

    Note that in each if statement it ends with a zero because you don't want the result of the effort to be null because that will wreck the total, and make it blank. 



    ------------------------------
    Mark Shnier (Your Quickbase Coach)
    mark.shnier@gmail.com
    ------------------------------
    • TonyGonzalez's avatar
      TonyGonzalez
      Qrew Member

      Mark,

      That's closer to an excel formula than I thought.  Did you possibly leave out the "condition"?  Should it be more like...

      IF([field 1], true, 1,0)

      +IF([field 2], true, 2,0)

      +IF([field 3], true, 5,0)

      Just thinking there isn't a condition to be met in your version.  



      ------------------------------
      Gonzo - A Newbie, but learning fast. (Former SmartSheet evangelist who is quickly converting to QuickBase)
      IT Director City of New Braunfels
      ------------------------------
    • TonyGonzalez's avatar
      TonyGonzalez
      Qrew Member

      Thanks, Mark.  I was able to work it out with a little more time.  End result, for others possible future reference....

      Sum(
      If([Field1]=true, 676.54, 0)
      +If([Field2]=true, 71.64, 0)
      +If([Field3]=true, 286.47,0)
      +If([Field4]=true, 297.62, 0)
      +If([Field5]=true, 297.62, 0))



      ------------------------------
      Gonzo - A Newbie, but learning fast. (Former SmartSheet evangelist who is quickly converting to QuickBase)
      IT Director City of New Braunfels
      ------------------------------

      • MarkShnier__You's avatar
        MarkShnier__You
        Qrew #1 Challenger

        Your formula will work fine, what the Sum is superfluous.

        Also when testing a bully and checkbox field that checkbox field is either true or false inherently so you don't really have to test it against true. For example this is the same thing as I originally wrote just more verbose.  I do recognize it's probably easier to read the way you wrote it. (aside form the superfluous SUM(     )

        If([Field1]=true, 676.54, 0)
        +If([Field2]=true, 71.64, 0)
        +If([Field3]=true, 286.47,0)
        +If([Field4]=true, 297.62, 0)
        +If([Field5]=true, 297.62, 0)



        ------------------------------
        Mark Shnier (Your Quickbase Coach)
        mark.shnier@gmail.com
        ------------------------------