Question

Hi, I need help with excel. I need to find the highest and lowest score from...

Hi, I need help with excel. I need to find the highest and lowest score from different soccer matches. For example;

match 1 = (2 - 0)

match 2 = (3 - 1)

match 3 = (0 - 1)

match 4 = (2 - 3)

How can I use index, max, min and match functions to automatic find the highest and lowest scores ? for example, match 4 = highest, match 3 = lowest.

Excel edition 2016

There is basically no inputs in this one. I just want to know how to type in the right functions to get the answer.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

INDEX function (To use in VBA, we write WorksheetFunction.Index() ):

This is used to find a particular value in a range or array, given the range or array, and the row number.

Syntax:

INDEX (array/range, row_num, [col_num])

*column number is optional*

MATCH function (To use in VBA, we write WorksheetFunction.Match()):

This returns the index of a particular value in a given range/array.

Syntax:

MATCH(value, array/range, [match_type])

*match_type = 0 for exact match, 1 for approximate/nearest match*

MAX function (To use in VBA, we write WorksheetFunction.Max()):

This returns maximum value in a array/range.

Syntax:

MAX(array/range)

*MIN function is similar, but different than MAX as it returns minimum in a array/range*

Steps for Solution: (Refer to VBA code also)

Fill the excel sheet like shown in figure:

B C D team A team B Score 1 3 match 1 4 match 2 5 match 3 6 match 4

Step1: Calculate the sum of points of both teams in each match, to get the score.Store it in an array, and fill these values in the Score column.

Step2: Find the maximum and minimum of these scores, using Max and Min function.

Step3: By using Match function, get the index/row number of maximum and minimum scores.

Step4: By using Index function, get the corresponding match numbers of highest and lowest scores.

VBA Code(Explanation also in Comments):

Sub Score()

'array to store scores
Dim scoresum(1 To 4) As Integer
Dim i As Integer
Dim j As Integer
Dim maxscore As Integer
Dim minscore As Integer
Dim ind As Integer
Dim hmatch As String
Dim lmatch As String

'variable to iterate in scoresum array
j = 1

'For loop to calculate sum of points and store in scoresum array
'also fill these values in Score clumn in the sheet
For i = 3 To 6
scoresum(j) = Cells(i, 2).Value + Cells(i, 3).Value
Cells(i, 4).Value = scoresum(j)
j = j + 1
Next i

'find maximum score from the array
maxscore = WorksheetFunction.Max(scoresum)
'find index of maximum score in the score column
ind = WorksheetFunction.match(maxscore, Range("D3:D6"), 0)
'find the corresponding match number using index function
hmatch = WorksheetFunction.Index(Range("A3:A6"), ind)

'find minimum score from the array
minscore = WorksheetFunction.Min(scoresum)
'find index of minimum score in the score column
ind = WorksheetFunction.match(minscore, Range("D3:D6"), 0)
'find the corresponding match number using index function
lmatch = WorksheetFunction.Index(Range("A3:A6"), ind)

'Print in message box
MsgBox (hmatch + " = highest, " + lmatch + " = lowest")

End Sub
Output SS:

B C D E F G H team A team B Score Microsoft Excel 2 3 match 1 4 match 2 5 match 3 6 match 4 1 1 match 4 = highest, match 3 =

Add a comment
Know the answer?
Add Answer to:
Hi, I need help with excel. I need to find the highest and lowest score from...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Lowest Score Drop In Functions, there can only be one return statement. You can not use...

    Lowest Score Drop In Functions, there can only be one return statement. You can not use an exit or break function. Write a program that calculates the average of a group of test scores, where the lowest score in the group is dropped. It should use the following functions: void getScore() should ask the user for a test score, store it in a reference parameter variable, and validate it. This function should be called by main once for each of...

  • Please I need help in C language, I am trying to modify the code per the...

    Please I need help in C language, I am trying to modify the code per the below instructions, but I am getting errors. Can't fgure it out. The attempted code modification and data file is privided below, after the instructions. Thank you. Instructions:                  1.      First, add a function named printMsg that displays a message, a greeting, or an introduction to the program for the user. Add a statement that calls that function from the main function when your program starts....

  • Using Python 3, is there a way I could find the second_highest value of a user's...

    Using Python 3, is there a way I could find the second_highest value of a user's random input using a while-loop? For example, if I use random input numbers such as: 100,95,92,87,83,80,75,50,40 etc. I want it to compute the 2nd highest along with my highest and lowest score. Is there any if, else, elif, etc statement that I could add to my while statement or in my while-loop to make this happen? The output would be something like highest =...

  • Please Write in C++ (10-30) @ 11:55pm 1.9 HW7 This homework assignment gives you the opportunity...

    Please Write in C++ (10-30) @ 11:55pm 1.9 HW7 This homework assignment gives you the opportunity to practice functions, functions that call other functions, reference variables, logical statements (what is meant by logical statement is a statement such as if, if/else if, switch), and input validation, HW7 (Graded out of 100) A talent competition has 5 judges, each of whom awards a score between 0 and 10 for each performer. Fractional scores, such as 8.3, are allowed. A performer's final...

  • I need help with this c++ question please thank you ltls. The program should urt valte....

    I need help with this c++ question please thank you ltls. The program should urt valte. 11. Lowest Score Drop Write a program that calculates the average of a group of test scores, where the lowest score in the group is dropped. It should use the following functions: void getscore() should ask the user for a test score, store it in a reference param- eter variable, and validate it. This function should be called by main once for each of...

  • Must be written in Python3 A particular talent competition has 7 judges, each of whole awards...

    Must be written in Python3 A particular talent competition has 7 judges, each of whole awards a score between 0 and 10 to each performer. A performer's final score is determined by dropping the highest and lowest score received, then averaging the 5 remaining scores. Define a class named ScoreCalculator that contains member variables and member functions based on the following: member variables: list of scores member function: 1) Initialization function: When creating an instance, create a score list as...

  • this is the qestion it has to be in java Example of what i need y...

    this is the qestion it has to be in java Example of what i need y Booleato Tools Window Help Hesustor X C C CB https:/class.mimiloassignments/e645f0d9-8eb-4d9b-818-6bb684bBeb/do/90db2810 O Reset to Starter 10 points possible CH4 Exerc. Seved Question 3 Question 3 Write a program that prompts the user for student grades and displays the highest and lowest grades in the class. The user should enter a character to providing values Grading Full Screen • MaxMinGrades.Java New } catch (Exception e) {...

  • I really would appreciate some help with this assignment and include comments please as I am...

    I really would appreciate some help with this assignment and include comments please as I am in this for learning. Part I: Maximum increasing subsequence (adapted from Programming Exercise 22.2) Write a program MaxlncreasingSubseq.java that prompts the user to enter a string and displays a maximum length increasing subsequence of characters. Here are four sample runs Enter a string: zebras ers Enter a string: Welcome Welo Enter a string: mmmoooooovwwvee mov Enter a string: abqrstcxyzdefghij abcdefghij You must use dynamic...

  • Can I get the normal graph explanation to this question, NOT USING EXCEL. yto All DATE...

    Can I get the normal graph explanation to this question, NOT USING EXCEL. yto All DATE & TIME 1/17/20 Forward Recipients Mess PROBLEM 4 The grades on the midterm examination given in a large managerial statistics class are normally distributed with mean 75 and standard deviation 9. The instructor of this class u must use normal graphs from our notes to solve these problems. wants to assign an A grade to the top 10% of the scores, a B grade...

  • I am given an input file, P1input.txt and I have to write code to find the...

    I am given an input file, P1input.txt and I have to write code to find the min and max, as well as prime and perfect numbers from the input file. P1input.txt contains a hundred integers. Why doesn't my code compile properly to show me all the numbers? It just stops and displays usage: C:\> java Project1 P1input.txt 1 30 import java.io.*; // BufferedReader import java.util.*; // Scanner to read from a text file public class Project1 {    public static...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT