You are on page 1of 25

CSC408 UiTM Sarawak MS-Excel Manual 1

CSC408:
MS Excel
Manual 1(Part 3)
Tutorial 3

pg. 1
CSC408 UiTM Sarawak MS-Excel Manual 1

CSC408: MS-Excel Manual 1 (Part 3)


Prepared by: Adeena Mazwa Rabytah Binti Amir Abdullah
Compiled & verified by: Dr Azlina Bujang
This manual will cover the following topics:

1. Using COUNT function


2. Using SUM function
3. Using IF function
4. Using AVERAGE function
5. Using COUNTIF function
a. Numeric Criteria
b. Text Criteria
c. Count Booleans
d. And Criteria
e. Or Criteria
6. Using SUMIF function
a. Numeric Criteria
b. Text Criteria
c. Date Criteria
d. And Criteria
e. Or Criteria
7. Using MIN function
8. Using MAX function

pg. 2
CSC408 UiTM Sarawak MS-Excel Manual 1

1. Using COUNT function

COUNT function is used to count the number of cells that contain numbers.

Tips: You can use COUNTA function to count all cells that are not empty. COUNTA stands for
count all.

pg. 3
CSC408 UiTM Sarawak MS-Excel Manual 1

2. Using SUM function

SUM function is used to sum a range of cells in Excel. The SUM function below sums all
values in column A.

Tips: You can use this SUM function to sum an entire row too. For example. =SUM(5:5) sums
all the value in the 5th row.

pg. 4
CSC408 UiTM Sarawak MS-Excel Manual 1

3. Using IF function

The IF function checks whether a condition is met and returns one value if true and another
value if false.

If the score is greater than or equal to 60, the IF function shown above returns Pass, else it
returns Fail. To quickly copy this formula to the other cells, click on the lower right corner of
cell C2 and drag it down to cell C6.

You can use the following comparison operators:


= (equal to)
> (greater than)
< (less than)
>= (greater than or equal to)
<= (less than or equal to)
<> (not equal to)

pg. 5
CSC408 UiTM Sarawak MS-Excel Manual 1

4. Using AVERAGE function

To calculate the average of a group of numbers, use the AVERAGE function. The formula
below calculates the average of the top 3 numbers in the range A1:A6.

The LARGE function returns the array constant {20, 15, 10}. This array constant is used as an
argument for the AVERAGE function, giving the result of 15.

You can still use AVERAGE function without the LARGE function. You can refer to the
example below:

This shows how AVERAGE function calculates the average of the numbers in cells A1 through
A3 and return the value of 7 in cell A4.

pg. 6
CSC408 UiTM Sarawak MS-Excel Manual 1

5. Using COUNTIF function

The COUNTIF function in Excel counts cells based on one criterion. Let us look at various
criteria which is available for COUNTIF function.

Numeric Criteria
Use the COUNTIF function in Excel to count cells that are equal to a value, count cells that
are greater than or equal to a value, etc.
1. The COUNTIF function below counts the number of cells that are equal to 20.

2. The following COUNTIF function gives the exact same result.

pg. 7
CSC408 UiTM Sarawak MS-Excel Manual 1

3. The COUNTIF function below counts the number of cells that are greater than or equal
to 10.

4. The COUNTIF function gives the exact same result.

The & operator joins the ‘greater than or equal to’ symbol and the value in cell C1.
5. The COUNTIF function below counts the number of cells that are not equal to 7.

pg. 8
CSC408 UiTM Sarawak MS-Excel Manual 1

6. The COUNTIF functions below count the number of cells that are equal to 3 or 7.

Text Criteria
Use the COUNTIF function in Excel to count cells that contain specific text. Always enclose
text in double quotation marks.
1. The COUNTIF function below counts the umber of cells that contain exactly star.

pg. 9
CSC408 UiTM Sarawak MS-Excel Manual 1

2. The COUNTIF function below counts the number of cells that contain exactly star + 1
character. A question mark (?) matches exactly one character.

3. The COUNTIF function below counts the number of cells that contain exactly star + a
series of zero or more characters. An asterisk (*) matches a series of zero or more
characters.

pg. 10
CSC408 UiTM Sarawak MS-Excel Manual 1

4. The COUNTIF function below counts the number of cells that contain star in any way.

5. The COUNTIF function below counts the number of cells that contain text.

pg. 11
CSC408 UiTM Sarawak MS-Excel Manual 1

Count Booleans
Use the COUNTIF function in Excel to count Boolean values (TRUE or FALSE).
1. The COUNTIF function below counts the number of cells that contain the Boolean
TRUE.

2. The COUNTIF function below counts the number of cells that contain the Boolean
FALSE.

pg. 12
CSC408 UiTM Sarawak MS-Excel Manual 1

And Criteria
Counting with And criteria in Excel is easy where you can use COUNTIFS (with the letter S at
the end). It calculates cells based on two or more criteria.
1. For example, to count the number of rows that contain Google and Stanford, simply
use the COUNTIFS function.

Or Criteria
Counting with Or criteria in Excel can be tricky.
1. The COUNTIF functions below count the number of cells that contain Google or
Facebook (one column).

pg. 13
CSC408 UiTM Sarawak MS-Excel Manual 1

2. However, if you want to count the number of rows that contain Google or Stanford (two
columns), you cannot simply use the COUNTIF function twice (see picture below).

Rows that contain Google and Stanford are counted twice, but they should only be
counted once. The correct answer is 4.
3. To solve the issue, you will need to use the array formula as below:

Finish an array formula by pressing CTRL + SHIFT + ENTER. Excel adds the curly
braces {}.

pg. 14
CSC408 UiTM Sarawak MS-Excel Manual 1

6. Using SUMIF function

The SUMIF function in Excel sums cells based on one criterion. Let us look into how this
SUMIF function works.

Numeric Criteria
Use the SUMIF function in Excel to sum cells based on numbers that meet specific criteria.
1. The SUMIF function below (two arguments) sums values in the range A1:A5 that are
less than or equal to 10.

2. The following SUMIF function gives the exact same result. The & operator joins the
‘less than or equal to’ symbol and the value in cell C1.

pg. 15
CSC408 UiTM Sarawak MS-Excel Manual 1

3. The SUMIF function below (three arguments, last argument is the range to sum) sums
values in the range B1:B5 if the corresponding cells in the range A1:A5 contain the
value 25.

4. The following SUMIF function gives the exact same result (second argument refers to
cell D1).

pg. 16
CSC408 UiTM Sarawak MS-Excel Manual 1

Text Criteria
Use the SUMIF function in Excel to sum cells based on text strings that meet specific criteria.
Always enclose text in double quotation marks.
1. The SUMIF function below sums values in the range B1:B5 if the corresponding cells
in the range A1:A5 contain exactly circle.

2. The SUMIF function below sums values in the range B1:B5 if the corresponding cells
in the range A1:A5 do not contain exactly triangle.

pg. 17
CSC408 UiTM Sarawak MS-Excel Manual 1

3. The SUMIF function below sums values in the range B1:B5 if the corresponding cells
in the range A1:A5 contain exactly circle + 1 character. A question mark (?) matches
exactly one character.

4. The SUMIF function below sums values in the range B1:B5 if the corresponding cells
in the range A1:A5 contain a series of zero or more characters + le. An asterisk (*)
matches a series of zero or more characters.

5. The SUMIF functions below sum values in the range B1:B5 if the corresponding cells
in the range A1:A5 contain exactly triangle or circle8.

pg. 18
CSC408 UiTM Sarawak MS-Excel Manual 1

Date Criteria
You can use the SUMIF function in Excel to sum cells based on dates that meet specific
criteria.
1. The SUMIF function below sums the sales after January 20th,2018.

The DATE function in Excel accepts three arguments: year, month, and day.
2. The SUMIF function below sums today’s (August 3rd, 2018) sales.

pg. 19
CSC408 UiTM Sarawak MS-Excel Manual 1

3. The SUMIFS function (with the letter S at the end) sums the sales between two dates.

The SUMIFS function in Excel sums cells based on two or more criteria (first argument
is the range to sum, followed by two or more range/criteria pairs). Adjust the dates to
sum the sales in a specific month, year, etc.

And Criteria
To sum with And criteria in Excel is easy.
1. For example, to sum the cells that meet the following criteria: Google and Stanford
(two criteria ranges), simply use the SUMIFS function (with the letter S at the end).

When using the SUMIFS function, the first argument is the range to sum, followed by
two or more range/criteria pairs.

pg. 20
CSC408 UiTM Sarawak MS-Excel Manual 1

Or Criteria
To sum with Or criteria in Excel can be tricky.
1. The formula below sums the cells that meet the following criteria: Google or Facebook
(one criteria range).

2. However, if you want to sum the cells that meet the following criteria: Google or
Stanford (two criteria ranges), you cannot simply use the SUMIF function twice as
shown in the picture below.

pg. 21
CSC408 UiTM Sarawak MS-Excel Manual 1

3. The array formula below does the trick:

pg. 22
CSC408 UiTM Sarawak MS-Excel Manual 1

7. Using MIN function

To find the minimum value, use the MIN function.

8. Using MAX function

To find the maximum value, use the MAX function.

pg. 23
CSC408 UiTM Sarawak MS-Excel Manual 1

TUTORIAL 3

In this exercise, you will need to create one worksheet in one workbook. Please read the
instructions carefully.

Employee List Worksheet


1. Open a new black worksheet. Create the spreadsheet below by entering all the data.

2. Key in the spreadsheet and adjust columns widths as needed.


3. Set the Salary column as Currency (RM) data type. (Hint: Do NOT key in “RM” in every
cell for the Salary column as it will cause an error to find MIN and MAX later.)
4. Set the Date Hired as Date (DD Month YYYY).
5. Use the SUM function to calculate the total salary of all employees.
6. At the bottom of the list, create a box as shown below:

7. Find the max, min, and average salary. (Hint: Use the Salary column only to find these
values).

pg. 24
CSC408 UiTM Sarawak MS-Excel Manual 1

8. Finally, create this table anywhere in the same sheet as shown below:

9. Find the total number of staffs who earn more than RM60,000 per year.
10. Find the total number of staffs who come from “Savannah”.
11. Find the percentage of staffs who earn more than RM60,000 per year. (Hint: Use the
total number of staff who earns more than RM60,000 divide by grand total number of
staffs and set the data type as Percentage).
12. Find the percentage of staffs who come from “Savannah”. (Hint: Use the total number
of staff who comes from “Savannah” divide by grand total number of staffs and set the
data type as Percentage).
13. Save the file as CSC408_ Tutorial 3_StudentID.xls

pg. 25

You might also like