Forum Discussion

JohnDonnelly's avatar
JohnDonnelly
Qrew Trainee
5 years ago

Formula to Count Total # of Fields the are Checked

Is there a formula that can help me count the total number of checkbox fields that are checked/positive?  I have 12-15 Checkbox fields in a particular table, and I'd like to identify the total/sum that are checked for an individual record.

------------------------------
John
------------------------------

4 Replies

  • np,  Try this

    Count(
    [checkbox field 1],
    [checkbox field 2],
    [checkbox field 3],
    [checkbox field 4],
    [checkbox field 5],
    [checkbox field 6],
    [checkbox field 7],
    [checkbox field 8],
    ...
    etc.
    ...
    [checkbox 12-15])

    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------
    • SteveHanson's avatar
      SteveHanson
      Qrew Trainee
      It took me a minute to figure out why this wasn't working; I had to select the formula under Columns to Display, and change formula from Tex to Numeric. This was handy to get the total within each record to display at the end of the record row, but how do I get the report to total each column?

      ------------------------------
      Steve Hanson
      ------------------------------
      • SteveHanson's avatar
        SteveHanson
        Qrew Trainee
        Another rookie mistake. It turns out what I was looking for was already built-in. In the field settings, under Checkbox field options I clicked Show a "totals" row in reports. This then produced a row at the bottom totaling up all the checkboxes for each column of my report. 



        ------------------------------
        Steve Hanson
        ------------------------------
  • Use ToNumber to turn the true value of a checkbox to the number 1:


    Sum(
    ToNumber([field1]),
    ....,
    ToNumber([fieldn])
    )


    ...Just saw Mark's post and that is valid too.

    ------------------------------
    Adam Keever
    ------------------------------