View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
[email protected] utkarsh.majmudar@gmail.com is offline
external usenet poster
 
Posts: 13
Default Help with a function

Assuming the scores of the five judges are entered in cells A1 through
E1 then in cell F1 enter the following formula:

=IF(OR(H1=4,H1=5),ROUNDDOWN((SUM(A1:E1)-SMALL(A1:E1,1)-LARGE(A1:E1,1))/G1,3),ROUNDDOWN(SUM(A1:E1)/G1,3))

In cell G1 the formula

=IF(OR(COUNT(A1:E1)=4,COUNT(A1:E1)=5),COUNT(A1:E1)-2,COUNT(A1:E1))

and in cell H1

=COUNT(A1:E1)

The output in cell F1 will give you the average score that you need.

You may wish to hide columns G and H for neatness.

You don't really need VBA to do this!

Utkarsh