Excel - Part IV
Excel - Part IV
VLOOKUP Function
Use VLOOKUP, one of the lookup and reference functions, when you need to find things in a table or a
range by row. For example, look up an employee's last name by her employee number, or find her phone
number by looking up her last name (just like a telephone book).
The secret to VLOOKUP is to organize your data so that the value you look up (employee’s last name) is
to the left of the return value you want to find (employee’s phone number).
Syntax
VLOOKUP (lookup_value, table_array, col_index_num, [range_lookup])
For example:
• =VLOOKUP(105,A2:C7,2,TRUE)
• =VLOOKUP("Fontana",B2:E7,2,FALSE)
A logical value that specifies whether you want VLOOKUP to find an exact
match or an approximate match:
• TRUE assumes the first column in the table is sorted either numerically
range_lookup (optional) or alphabetically, and will then search for the closest value. This is the
default method if you don't specify one.
• FALSE searches for the exact value in the first column.
INDEX function
The Microsoft Excel INDEX function returns either the value or the reference to a value from a
table or range.
Syntax
INDEX(array, row_num, [column_num])
The INDEX function syntax has the following arguments.
Page 1 of 9
o If array has more than one row and more than one column, and only Row_num or
Column_num is used, INDEX returns an array of the entire row or column in array.
• Row_num Required. Selects the row in array from which to return a value.
If Row_num is omitted, Column_num is required.
• Column_num Optional. Selects the column in array from which to return a value.
If Column_num is omitted, Row_num is required.
Example:
Search by INDEX
Row 3
column 1
Result =INDEX(B2:D7,3,1)
Search by VlookUp
Name Joe
Village =VLOOKUP(B3,B3:D7,3,0)
1. SUMIF( )
Syntax
SUMIF(range, criteria, [sum_range])
The SUMIF function syntax has the following arguments:
• range Required. The range of cells that you want evaluated by criteria. Cells in each range must
be numbers or names, arrays, or references that contain numbers. Blank and text values are
ignored.
• criteria Required. The criteria in the form of a number, expression, a cell reference, text, or a
function that defines which cells will be added. For example, criteria can be expressed as 32,
">32", B5, "32", "apples", or TODAY().
Page 2 of 9
Important Any text criteria or any criteria that includes logical or mathematical symbols must be
enclosed in double quotation marks ("). If the criteria is numeric, double quotation marks are not
required.
• Sum_range Optional. The actual cells to add, if you want to add cells other than those specified
in the range argument. If the sum_range argument is omitted, Excel adds the cells that are
specified in the range argument (the same cells to which the criteria is applied).
• You can use the wildcard characters—the question mark (?) and asterisk (*)—as the criteria
argument. A question mark matches any single character; an asterisk matches any sequence of
characters. If you want to find an actual question mark or asterisk, type a tilde (~) preceding the
character.
Example
2. COUNTIF( )
The COUNTIF function counts the number of cells that meet criteria you specify.
Syntax
COUNTIF(range, criteria)
For example:
• =COUNTIF(A2:A5,"apples")
• =COUNTIF(A2:A5,A4)
Page 3 of 9
Argument name Description
The group of cells you want to count. Range can contain numbers, arrays, or
range (required)
references that contain numbers. Blank and text values are ignored.
A number, expression, cell reference, or text string that determines which cells will
be counted.
For example, you can use a number like 32, a comparison like ">32", a cell like B4,
criteria (required)
or a word like "apples".
COUNTIF uses only a single criteria. Use COUNTIFS if you want to use multiple
criteria.
Examples
Data Data
apples 32
oranges 54
peaches 75
apples 86
Page 4 of 9
3. AVERAGEIF( )
The Microsoft Excel AVERAGEIF function returns the average of all numbers in a range of cells,
based on a given criteria.
Syntax
AVERAGEIF(range, criteria, [average_range])
The AVERAGEIF function syntax has the following arguments:
• Range Required. One or more cells to average, including numbers or names, arrays, or
references that contain numbers.
• Criteria Required. The criteria in the form of a number, expression, cell reference, or text that
defines which cells are averaged. For example, criteria can be expressed as 32, "32", ">32",
"apples", or B4.
• Average_range Optional. The actual set of cells to average. If omitted, range is used.
Remarks
Examples
Property
Commission
Value
100000 7000
200000 14000
300000 21000
400000 28000
Page 5 of 9
Links between sheets and files.
You may want to use the value from a cell in another worksheet within the same workbook in a formula.
For example, the value of cell A1 in the current worksheet and cell A2 in the second worksheet can be
added using the format "sheetname!celladdress". The formula for this example would be
"=A1+Sheet2!A2" where the value of cell A1 in the current worksheet is added to the value of cell A2 in
the worksheet named "Sheet2".
3D-reference
A 3D-reference in Excel refers to the same cell or range on multiple worksheets. First, we'll look
at the alternative.
1. On the Company sheet, select cell B2 and type an equal sign =
3. Repeat step 2 for the Mid and South sheet by clicking on the shift
Page 6 of 9
Workshop IV
Ex 1:
1. Write the following 2 tables on the first worksheet
Invoice No. : 10
Page 7 of 9
Ex 2
Sheet1
Full Name Salary
Rima $350.00
Saideh $450.00
Rita $650.00
Joe $275.00
Rana $825.00
paula $1,000.00
Lina $600.00
Laura $700.00
Toni $5,500.00
Georges $400.00
Dani $3,500.00
Sheet 2
Nbre of
Full Name Salary Status Tax Bonus Salary Net
Kids
Rima M 3
Saideh S 0
Rita W 1
Joe D 3
Rana M 1
paula M 5
Lina D 0
Laura W 2
Toni S 1
Georges M 0
Dani M 2
Total
Minimum Nbre of kids
Maximum Nbre of kids
Nbre of Singles
SUM of salary that the status=S
SUM of salary that the status=W
SUM of salary that the status=D
Page 8 of 9
Questions
Page 9 of 9