Results 1 to 3 of 3
  1. #1
    Twitchie is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2014
    Posts
    20

    Calculating an average from checkboxes?


    Greetings. I have a report that I'd like to create a scorecard within. The scores will be expressed as percentages. I have 8 categories of tasks, and each category has a differing number of activities within it. When an activity is completed, the user checks a box indicating it is done. So I'd like to calculate the percentage of a category. I've tried creating a control that has =Abs([Task_1_1_Flag]+[Task_1_2_Flag])/2 in the On Update and On Enter to just calculate the percentage on the fly when the report is accessed, but the field is blank when loaded despite 1 of the 2 checkboxes displaying as checked on the report. The percentages don't necessarily need to be stored in the table, but could be if that's easier. Much thanks!

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,954
    A checkbox can have a null state. Arithmetic with null results in null. Not sure that is the issue here, but try:

    =Abs(Nz([Task_1_1_Flag],0)+Nz([Task_1_2_Flag],0))/2

    Saving calculated data (data dependent on other data) is usually bad design. These checkbox entries are dependent data. Relying on user to remember to make this entry will be constant source of data inaccuracy and frustration. Whether or not an activity is completed could be determined with query and calculation.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Twitchie is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2014
    Posts
    20
    Thank you very, very much!! This particular project is very reliant upon people checking the boxes - it's actually part of the task. I just needed a quick snapshot of the progress people have made across the 8 categories. It's been a little while since I've sat and worked in Access. I've learned some SQL and work in Oracle Developer now so I keep getting that in my head as how I would query something I wanted. Thanks again for the assistance. Much appreciated! And I will use the forum tool to mark this as solved.

    Quote Originally Posted by June7 View Post
    A checkbox can have a null state. Arithmetic with null results in null. Not sure that is the issue here, but try:

    =Abs(Nz([Task_1_1_Flag],0)+Nz([Task_1_2_Flag],0))/2

    Saving calculated data (data dependent on other data) is usually bad design. These checkbox entries are dependent data. Relying on user to remember to make this entry will be constant source of data inaccuracy and frustration. Whether or not an activity is completed could be determined with query and calculation.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 9
    Last Post: 11-26-2013, 12:02 PM
  2. Calculating a weighted average
    By lugnutmonkey in forum Queries
    Replies: 2
    Last Post: 01-29-2013, 04:49 PM
  3. Calculating the Total of Average Fields
    By DDEB in forum Queries
    Replies: 1
    Last Post: 05-09-2012, 06:26 PM
  4. any idea on calculating average?
    By sk88 in forum Access
    Replies: 3
    Last Post: 08-30-2011, 11:32 PM
  5. Calculating average in table
    By prv in forum Database Design
    Replies: 1
    Last Post: 12-14-2010, 01:35 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums