How to calculate the Average of a Row in MS access

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Hmaggie93
    New Member
    • May 2013
    • 6

    #1

    How to calculate the Average of a Row in MS access

    I have average student scores across 5 fields in a query, i need to get access to calculate the average across the row so i have an average columb.
    p.s. i am relativity new to access and a dumbed down answer would be lovely
  • Seth Schrock
    Recognized Expert Specialist
    • Dec 2010
    • 2965

    #2
    Lets say that your fields are named Field1, Field2, etc. You just need to use the following in the SQL view of your query:
    Code:
    (Field1 + Field2 + Field3 + Field4 + Field5)/5 AS aveColumn
    You can also do this in the design view of the query by typing aveColumn: and then the calculation after that. This will get the average of the five fields in the one record.

    Comment

    • Hmaggie93
      New Member
      • May 2013
      • 6

      #3
      You are beautiful. Thank you so much.

      Comment

      • Seth Schrock
        Recognized Expert Specialist
        • Dec 2010
        • 2965

        #4
        Glad to be able to help.

        Comment

        • NeoPa
          Recognized Expert Moderator MVP
          • Oct 2006
          • 32669

          #5
          There are one or two gotchas that you may need to handle :
          1. If any of the fields are Null then the calculation will return Null.
          2. Sometimes people want to exclude any Null values from the calculation. If your SQL does that then be sure to allow for division-by-zero error for when all fields are Null.

          Comment

          Working...