Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Help   Contact   Merch   Join   Order   Logon   Forums   
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Calculate Average of The Two Highest
aza 

16 years ago
I am a teacher and trying hard to save records of my students co-curriculum achievements.
I've been trying to calculate the average of top two marks out of three marks of each of my students.
BUT How do i tell Access to auto detect the two highest scores for that particular student?


From Table : StudentsMarks

ID | StudentName | Uniform | Club | Sports | AverageTwo
1 | Alia | 20 | 12 | 35 | (get from calculation)
2 | Vikram | 14 | 28 | 3 |(get from calculation)
3 | Farah | 17 | 23 | 29 |(get from calculation)

I want to make it like this
For Alia, the average of top two marks is
( 20 + 35 ) / 2 = AverageTwo

For Vikram, the average of top two marks is
(14 + 28) / 2 = AverageTwo

For Vikram, the average of top two marks is
(23 + 29) / 2 = AverageTwo


Can anyone help me please. Thank you in advance.


Reply from Richard Rost:

Since your values are stored in a single table, you're going to have to use a complex IIF statement in a query to calculate this. Let's say you have three fields F1, F2, and F3. Your formula would be:

TopScore: IIF(AND(F1>F2,F1>F3),F1,IIF(AND(F2>F1,F2>F3),F2,F3))

That will calculate the TOP score. Now, all of my Access students want homework, so let's see who will be the first to calculate the NEXT highest score. It's a little bit trickier, but along the same lines.

Anyone...???

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
 
What's This?

 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 9/12/2026 5:38:55 PM. PLT: 1s