Results 1 to 4 of 4
  1. #1
    azhar2006's Avatar
    azhar2006 is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2012
    Posts
    528

    average in the report


    Hello all
    I'm trying to get the result (average) in a column in the report
    And put something like this
    But tell me that there are arguments and the like
    = IIf (([C2] = 0), 0, ([C2]) / (IIf ([C2]) = 0,0,1))) Click image for larger version. 

Name:	3233.JPG 
Views:	15 
Size:	22.5 KB 
ID:	14561

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,601
    Why are you using IIf that will return division by 0? Division by 0 is not possible.

    That expression does not average anything. The image shows C3 in the expression but your typed version does not.

    If you want to exclude zeros from average, since nulls are ignored, try:

    =Avg(IIf([C2]=0, Null, [C2])
    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
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    There are too many parenthesis and they are in the wrong places
    Try
    Code:
    = IIf([C2] = 0, 0, [C2] / IIf([C2] = 0, 0, 1))
    I hope this isn't the real expression... it doesn't make any sense.

  4. #4
    azhar2006's Avatar
    azhar2006 is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2012
    Posts
    528
    Thank you very much June7 and ssanfu Click image for larger version. 

Name:	332222.JPG 
Views:	11 
Size:	18.1 KB 
ID:	14567

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

Similar Threads

  1. Replies: 5
    Last Post: 10-11-2012, 06:46 PM
  2. How to do an average report
    By MattyB in forum Reports
    Replies: 0
    Last Post: 04-11-2011, 02:09 AM
  3. Report Help: counting and average
    By alliandrina in forum Reports
    Replies: 0
    Last Post: 03-08-2011, 01:24 PM
  4. Replies: 13
    Last Post: 05-28-2010, 11:57 AM
  5. report average calculation
    By ZipDoc in forum Reports
    Replies: 1
    Last Post: 01-28-2010, 09:08 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