Results 1 to 4 of 4
  1. #1
    ne1gold is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2017
    Posts
    6

    Report - Work out average of a sum, but only divide by fields not equal to zero

    Hi

    Thanks for all the help ive been getting off the forum. Been helping me a lot.

    So I have a little bit of a dilemma here.

    Click image for larger version. 

Name:	report example.JPG 
Views:	9 
Size:	99.5 KB 
ID:	32539

    So this is a report I have drawn from a query.

    I now have to work out average scores of the yellow and the blue vertical columns.

    The problem is that on every report these values changes based on what level the employee is on.

    So if on level 11 only the light pink horizontal fields are applicable and if level 9 only the light blue horizontal fields are applicable.

    Is there way to group these fields together and then write IF statement like this in the control source (not sure how to group fields?) :

    IF (level(field) >=9 or <=11, sum(group1) / (numberoffieldsingroup) ----- This will then give me the average score - So im not sure how to group these fiields and also not sure how to program a count of fields in group to divide it by.

    Hope this makes sense..

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,523
    in the query:
    =iif(denom = 0,0,numerator/denom)

  3. #3
    ne1gold is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2017
    Posts
    6
    Quote Originally Posted by ranman256 View Post
    in the query:
    =iif(denom = 0,0,numerator/denom)

    Thanks!!!

    Just one more thing, so im using the expression builder to try calculate values. But output stays blank :
    This is the expression :
    =IIf([Job Level FW]>=13,[Sum of core 13-16 FW]/5,0) Or ([Job Level FW] Between 9 And 12,[Sum of 9-12 FW]/15,0) Or ([Job Level FW] Between 7 And 8,[Sum of 7-8 FW]/10,0) Or ([Job Level FW]<=6,[Sum of 1-6 FW]/13,0)

    Any help would be appreciated

    Click image for larger version. 

Name:	expression builder.JPG 
Views:	17 
Size:	60.3 KB 
ID:	32542

  4. #4
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Each new condition must be its own "IIF", not "or". This gets very complex so be very careful, each IIF must have its own open and close bracketing.

    IIf(conditon1,..,IIf(condition 2,..,IIf(condition 3,...,...)))

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

Similar Threads

  1. Replies: 4
    Last Post: 02-14-2017, 04:38 PM
  2. Equal horizontal/vertical doesn't work?
    By warmslime in forum Access
    Replies: 1
    Last Post: 03-19-2016, 12:53 PM
  3. Divide report into four different areas
    By MyPaynes in forum Reports
    Replies: 1
    Last Post: 04-24-2014, 03:06 PM
  4. Divide two Fields, Total in another field
    By prawln in forum Access
    Replies: 1
    Last Post: 03-28-2011, 06:45 PM
  5. Replies: 13
    Last Post: 05-28-2010, 11:57 AM

Tags for this Thread

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