Download the Exercise 4 Spreadsheet from Webct. the Worksheet Entitled List Contains An

Total Page:16

File Type:pdf, Size:1020Kb

Download the Exercise 4 Spreadsheet from Webct. the Worksheet Entitled List Contains An

EXERCISE 4 Functions

Download the Exercise 4 spreadsheet from WebCT. The worksheet entitled List contains an extensive list of the various worksheet functions available in Excel. (Engineering functions have not been included.) The next worksheet, Examples, gives a little more description of some useful functions as well as some examples of how they work. Look at each of the functions, the examples, and notes on the examples. We will be using more of these functions later.

Now click on the Practice tab. This worksheet contains a “grade book” for six students with three exam grades. There are also some cells that we will fill in with functions.

First, obtain the average grade, minimum, maximum, and standard deviation of grades for each exam (in columns B, C and D, rows 9 – 12). In cell B9, type in “=AVERAGE(B2:B7)” and enter. This calculates the average grade on the First Exam for the class. In cell B10, type in “=MIN(B2:B7)” in order to find the lowest grade on the exam. In cell B11, the equation “=MAX(B2:B7)” will calculate the highest grade. Finally, in cell B12, type in “=STDEV(B2:B7)” in order to calculate the standard deviation. Copy cells B9 – B12 over to columns C and D to calculate these statistics for the second and third exams.

In column E, calculate the average grade for each student using the AVERAGE function. In cell E2, type in “=AVERAGE(B2:D2)” and enter. Now copy the equation to cells E3 – E7. To verify the average, let’s use the SUM and COUNT functions in column F. In cell F2, type in the equation “=SUM(B2:D2)/COUNT(B2:D2)” and enter. Copy cell F2 to cells F3 – F7. The values in columns E and F should match.

In cell E14, calculate the class average using the AVERAGE function on the students’ average grades in column E. In cell F14, calculate the class average using the SUM and COUNT functions of the students’ average grades.

Round the average student grade to the nearest whole number (in column G) using the ROUND function. For Aaragon, in cell H2 you should type “=ROUND(E2,0)” to round the average to the nearest integer. Cell H2 is formatted to one decimal so you can see that it actually did round to a whole number. Copy this cell down for the other students.

In Cell I2, let’s use the standard 60%, 70%, 80%, 90% cutoffs to assign letter grades for each student in Column H. We will need to use nested IF statements to do this. We can start at the top or the bottom. Let’s start with an “A” grade. We begin the statement with

=IF(H2>=90,”A”,to be continued)

The to be continued is just a way of noting that we still need to fill this in. The first part of the statement is checking to see if the student has an average of 90 or better, in which case we want to assign a text grade of “A”. If the student does not have an “A”, then we need to check if they should get a “B” grade. We check this by embedding another IF statement just like before but seeing if the average is at least 80 (this statement will only be used if the student’s average is not at least 90). In place of the to be continued we want to use the following:

=IF(H2>=80,”B”,to be continued-Part2) In this case, a grade of “B” will be assigned if the student’s average is at least 80. Continuing, we replace the latest italics part with

=IF(H2>=70,”C”,to be continued-Part3) to determine if a “C” should be assigned. Finally, we replace the last italics (Part 3) with the only two remaining possible outcomes:

=IF(H2>=60,”D”,”F”)

If the student’s grade is not at least 60, then an “F” is the only remaining option. Combining these equations, we get the following:

=IF(H2>=90,”A”,IF(H2>=80,”B”,IF(H2>=70,”C”,IF(H2>=60,”D”,”F”))))

Notice that there are a total of 4 IF statements, all of which are closed by the parentheses at the end of the equation.

Now let’s use the VLOOKUP function to assign grades in column J. The table in B19:C23 will be used to do this. We will be using the numbers in column B to determine the grade in column C to assign. Note that the VLOOKUP table must be in ascending order in column B (the lookup column) since the function “looks” for a number and, if it doesn’t find it exactly, drops down to the next lowest number actually in the table. This is why the table must start with a zero. (If you are looking up text, such as the first letter of a name, the same is true about having the lookup column appear in ascending, or in this case, alphabetical, order.) In cell J2, type in the following:

=VLOOKUP(H2,$B$19:$C$23,2)

H2 is the value that we are looking for in the table, $B$19:$C$23 is the table with columns and rows that we are using, and we want the corresponding value in the 2nd column to be applied to our equation. Note that I needed to use the dollar signs ($) to lock the lookup table for copying purposes.

The HLOOKUP function works the same as VLOOKUP but looks across a row rather than down a column. The corresponding HLOOKUP table to assign grades is in cells B28:F29. The HLOOKUP equation for the first student that we can place in cell K2 would be:

=HLOOKUP(H2,$B$28:$F$29,2)

We can also use IF statements to make comments that catch our attention. For example, we can identify the student with the best grade by writing a statement as follows:

=IF(H2=MAX($H$2:$H$7),"Star Student","")

When we copy this equation down, we find that 2 star students are identified. This is because we used the rounded test averages in column H. If we had used the averages in column E (or F), then only one student would have been identified as the Star Student. Note that the ELSE in the IF statement contains two quotation marks without anything in between them. This assigns a “value” to the cell, but is not a blank. That is, if you use the ISBLANK function on any of the non-Star Student comment cells, you will get the answer FALSE in that it is not a blank cell. However, it has not been assigned a space, either. The LEN function tells us that the cell has no characters at all (not even a blank).

Let’s combine some of the functions to calculate the average grade after dropping the lowest grade. We’ll place the result in column N. First, we need to check whether or not the student missed an exam. If not, we can sum the total of the three tests and subtract the lowest grade and then divide by 2. Otherwise, we just take the average of the remaining tests.

=IF(COUNT(B2:D2)=3,(SUM(B2:D2)-MIN(B2:D2))/2,AVERAGE(B2:D2))

This equation assumes that everyone took at least two tests. If a student had missed two tests and only got to drop one, we would have to modify the equation as follows:

=IF(COUNT(B2:D2)=3,(SUM(B2:D2)-MIN(B2:D2))/2,SUM(B2:D2)/2)

In this case, the last part of the statement says that if a student does not have three grades, sum up whatever grades exist and divide by two.

Recommended publications