Results 1 to 3 of 3
  1. #1
    al_mamun is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Oct 2013
    Posts
    2

    How to add best 3 values out the five fields.


    I want to add best 3 quiz marks from 5 quizzes appeared in a term. How can I build an expression for solving this problem in the expression builder.
    It is possible in MSExcel writing this formula = Sum(Large(E3:E7,1),Large(E3:E7,2),Large(E3:E7,3))

  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,626
    These marks are in 5 separate fields?

    Problem presented by any approach is case of ties. Consider grades: 83, 90, 91, 83, 83. If your data structure were normalized, a TOP n query could retrieve the top 3 marks. However, in that sample all 5 marks would return because of the 3 ties on 83 - all 3 are the third highest. Review http://allenbrowne.com/subquery-01.html#TopN
    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
    Dal Jeanis is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Dallas TX
    Posts
    1,742
    In VBA, you could SELECT TOP 3 into a recordset, and only read three records when calculating your sum.

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

Similar Threads

  1. Replies: 2
    Last Post: 05-29-2013, 12:54 PM
  2. Hide Fields With Null Values
    By jay in forum Reports
    Replies: 6
    Last Post: 09-22-2011, 07:23 AM
  3. Combine values from multiple fields
    By jsimard in forum Queries
    Replies: 8
    Last Post: 06-09-2011, 01:05 PM
  4. Look up values in multiple table fields
    By nmcentire in forum Programming
    Replies: 2
    Last Post: 11-12-2010, 02:02 PM
  5. Sum values in concatenated fields
    By jdrubins in forum Reports
    Replies: 4
    Last Post: 09-01-2009, 07:20 AM

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