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

I first entered data into the table to show every possible combination to check the query worked correctly

ID SN U C S TS STS
1 Alia 20 12 35 35 20
2 Vikram 14 28 3 28 14
3 Farah 17 23 29 29 23
4 Test 50 20 30 50 30
5 Test2 50 30 20 50 30
6 a1 1 2 3 3 2
7 a2 1 3 2 3 2
8 a3 2 1 3 3 2
9 a4 2 3 1 3 2
10 a5 3 1 2 3 2
11 a6 3 2 1 3 2
12 1 1 1 1 1

I then used Richard's Top Score

TopScore: IIf(([Uniform]>[Club] And [Uniform]>[Sports]),[Uniform],IIf(([Club]>[Uniform] And [Club]>[Sports]),[Club],[Sports]))

Now for the Second Top Score

IIf([Uniform]=[TopScore],IIf([Club]>[Sports],[Club],[Sports]),IIf([Club]=[TopScore],IIf([Uniform]>[Sports],[Uniform],[Sports]),IIf([Sports]=[TopScore],IIf([Uniform]>[Club],[Uniform],[Club]))))

This does quite a few checks.

Firstly is Uniform already the Top Score, if so check which is the highest out of the remaining two values and return that,
Then do the same for Club and Sports.
There is probably a better logical way of doing this, I'll keep working on it and post again if I figure it out,

Regards
Alex

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

Next Unseen

 
New Feature: Comment Live View
 
 

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: 6/9/2026 11:51:00 AM. PLT: 1s