Discussions

Expand all | Collapse all

Formula to Count Total # of Fields the are Checked

  • 1.  Formula to Count Total # of Fields the are Checked

    Posted 02-17-2020 12:10
    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
    ------------------------------


  • 2.  RE: Formula to Count Total # of Fields the are Checked

    Posted 02-17-2020 12:37
    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
    ------------------------------



  • 3.  RE: Formula to Count Total # of Fields the are Checked

    Posted 25 days ago
    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
    ------------------------------



  • 4.  RE: Formula to Count Total # of Fields the are Checked

    Posted 19 days ago
    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
    ------------------------------



  • 5.  RE: Formula to Count Total # of Fields the are Checked

    Posted 02-17-2020 12:38
    Edited by Adam Keever 02-17-2020 12:38
    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
    ------------------------------