Appendix E - Su Dung EXCEL
Appendix E - Su Dung EXCEL
Excel provides a wealth of functions for data management and statistical analysis. If we
know what function is needed, and how to use it, we can simply enter the function into
the appropriate worksheet cell. However, if we are not sure what functions are available
to accomplish a task or are not sure how to use a particular function, Excel can provide
assistance.
appear in alphabetic order in the Select a function box. We see the AVEDEV function listed
first, followed by the AVERAGE function, and so on.
The AVEDEV function is highlighted in Figure 1, indicating it is the function currently
selected. The proper syntax for the function and a brief description of the function appear
below the Select a function box. We can scroll through the list in the Select a function
box to display the syntax and a brief description for each of the statistical functions avail-
able. For instance, scrolling down farther, we select the COUNTIF function, as shown in
Figure 2. Note that COUNTIF is now highlighted, and that immediately below the Select a
function box we see COUNTIF(range,criteria), which indicates that the COUNTIF func-
tion contains two arguments, range and criteria. In addition, we see that the description of
the COUNTIF function is “Counts the number of cells within a range that meet the given
condition.”
If the function selected (highlighted) is the one we want to use, we click OK; the Func-
tion Arguments dialog box then appears. The Function Arguments dialog box for the
COUNTIF function is shown in Figure 3. This dialog box assists in creating the appropri-
ate arguments for the function selected. When finished entering the arguments, we click
OK; Excel then inserts the function into a worksheet cell.
FIGURE 4 EXCEL WORKSHEET WITH SOFT DRINK DATA AND LABELS FOR THE
FREQUENCY DISTRIBUTION WE WOULD LIKE TO CONSTRUCT
A B C D E
1 Brand Purchased Soft Drink Frequency
2 Coke Classic Coke Classic
3 Diet Coke Diet Coke
4 Pepsi Dr. Pepper
WEB file 5
6
Diet Coke
Coke Classic
Pepsi
Sprite
SoftDrink 7 Coke Classic
8 Dr. Pepper
9 Diet Coke
Note: Rows 11–44 10 Pepsi
are hidden. 45 Pepsi
46 Pepsi
47 Pepsi
48 Coke Classic
49 Dr. Pepper
50 Pepsi
51 Sprite
52
Appendix E Using Excel Functions 1065
drink data and labels for the frequency distribution we would like to construct. We see that
the frequency of Coke Classic purchases will go into cell D2, the frequency of Diet Coke
purchases will go into cell D3, and so on. Suppose we want to use the COUNTIF function
to compute the frequencies for these cells and would like some assistance from Excel.
Step 1. Select cell D2
Step 2. Click fx on the formula bar (or click the Formulas tab on the Ribbon and click
Insert Function in the Function Library group)
Step 3. When the Insert Function dialog box appears:
Select Statistical in the Or select a category box
Select COUNTIF in the Select a function box
Click OK
Step 4. When the Function Arguments box appears (see Figure 5):
Enter $A$2:$A$51 in the Range box
Enter C2 in the Criteria box (At this point, the value of the function will ap-
pear on the next-to-last line of the dialog box. Its value is 19.)
Click OK
Step 5. Copy cell D2 to cells D3:D6
The worksheet then appears as in Figure 6. The formula worksheet is in the background;
the value worksheet appears in the foreground. The formula worksheet shows that the
COUNTIF function was inserted into cell D2. We copied the contents of cell D2 into cells
D3:D6. The value worksheet shows the proper class frequencies as computed.
We illustrated the use of Excel’s capability to provide assistance in using the COUNTIF
function. The procedure is similar for all Excel functions. This capability is especially helpful
if you do not know what function to use or forget the proper name and/or syntax for a function.
A B C D E
1 Brand Purchased Soft Drink Frequency
2 Coke Classic Coke Classic =COUNTIF($A$2:$A$51,C2)
3 Diet Coke Diet Coke =COUNTIF($A$2:$A$51,C3)
4 Pepsi Dr. Pepper =COUNTIF($A$2:$A$51,C4)
5 Diet Coke Pepsi =COUNTIF($A$2:$A$51,C5)
6 Coke Classic Sprite =COUNTIF($A$2:$A$51,C6)
7 Coke Classic
8 Dr. Pepper A B C D E
9 Diet Coke 1 Brand Purchased Soft Drink Frequency
10 Pepsi 2 Coke Classic Coke Classic 19
45 Pepsi 3 Diet Coke Diet Coke 8
46 Pepsi 4 Pepsi Dr. Pepper 5
47 Pepsi 5 Diet Coke Pepsi 13
48 Coke Classic 6 Coke Classic Sprite 5
49 Dr. Pepper 7 Coke Classic
50 Pepsi 8 Dr. Pepper
51 Sprite 9 Diet Coke
52 10 Pepsi
45 Pepsi
Note: Rows 11–44 46 Pepsi
are hidden. 47 Pepsi
48 Coke Classic
49 Dr. Pepper
50 Pepsi
51 Sprite
52