Lecture Notes On Microsoft Excel
Lecture Notes On Microsoft Excel
of Microsoft Excel
BUITEMS
BUSHRA HAQ
Table of Contents
Spreadsheet Options............................................................................................................................... 4
Basic Formatting........................................................................................................................................ 11
Dates................................................................................................................................................. 12
Currency............................................................................................................................................ 13
Decimals............................................................................................................................................ 14
i
Additional Number Formats.................................................................................................................. 15
Cell Handles............................................................................................................................................... 16
Summary........................................................................................................................................... 23
Purpose............................................................................................................................................. 23
Return value...................................................................................................................................... 23
Syntax................................................................................................................................................ 23
Arguments......................................................................................................................................... 23
Usage notes....................................................................................................................................... 24
Examples........................................................................................................................................... 24
Notes................................................................................................................................................. 24
Summary........................................................................................................................................... 25
Purpose............................................................................................................................................. 25
Return value...................................................................................................................................... 25
Syntax................................................................................................................................................ 25
Arguments......................................................................................................................................... 25
ii
Usage notes....................................................................................................................................... 25
Summary........................................................................................................................................... 26
Purpose............................................................................................................................................. 26
Return value...................................................................................................................................... 26
Syntax................................................................................................................................................ 26
Arguments......................................................................................................................................... 26
Usage notes....................................................................................................................................... 27
Examples........................................................................................................................................... 27
Notes................................................................................................................................................. 27
Summary........................................................................................................................................... 28
Purpose............................................................................................................................................. 28
Return value...................................................................................................................................... 28
Syntax................................................................................................................................................ 28
Arguments......................................................................................................................................... 29
Usage notes....................................................................................................................................... 29
Summary........................................................................................................................................... 29
Purpose............................................................................................................................................. 30
Return value...................................................................................................................................... 30
Syntax................................................................................................................................................ 30
Arguments......................................................................................................................................... 30
iii
Usage notes....................................................................................................................................... 30
Summary........................................................................................................................................... 31
Purpose............................................................................................................................................. 31
Return value...................................................................................................................................... 31
Syntax................................................................................................................................................ 31
Arguments......................................................................................................................................... 31
Usage notes....................................................................................................................................... 32
Examples........................................................................................................................................... 32
Notes:................................................................................................................................................ 32
Summary........................................................................................................................................... 33
Purpose............................................................................................................................................. 33
Return value...................................................................................................................................... 33
Syntax................................................................................................................................................ 33
Arguments......................................................................................................................................... 33
Usage notes....................................................................................................................................... 34
Summary........................................................................................................................................... 34
Purpose............................................................................................................................................. 34
Return value...................................................................................................................................... 35
Syntax................................................................................................................................................ 35
Arguments......................................................................................................................................... 35
iv
Usage notes....................................................................................................................................... 35
Notes:................................................................................................................................................ 35
Summary........................................................................................................................................... 36
Purpose............................................................................................................................................. 36
Return value...................................................................................................................................... 36
Syntax................................................................................................................................................ 36
Arguments......................................................................................................................................... 37
Usage notes....................................................................................................................................... 37
Examples........................................................................................................................................... 37
Notes................................................................................................................................................. 38
Summary........................................................................................................................................... 38
Purpose............................................................................................................................................. 39
Return value...................................................................................................................................... 39
Syntax................................................................................................................................................ 39
Arguments......................................................................................................................................... 39
Usage notes....................................................................................................................................... 39
Other notes....................................................................................................................................... 43
v
LECTURE NOTES OF MICROSOFT EXCEL | BUITEMS
This guide to Excel is for those who have never used it before, are struggling with it as a
beginner, or just want the basics to then learn it on their own.
That being said, the application is not limited to numbers, although that’s where it “excels.”
You can add text, images, videos, objects, and many other items to help track, manage, and
easily view information.
BUSHRA HAQ
1
LECTURE NOTES OF MICROSOFT EXCEL | BUITEMS
The list goes on with the many uses for Excel. So, whatever you plan to use it for, let’s look
at a few of the terms you will need to know.
Workbook and Spreadsheet: A workbook is what you actually use when you open Excel.
The workbook contains the spreadsheets. A workbook can hold many spreadsheets and you
can move between those sheets with the tabs on the bottom of the Excel workbook.
Cell: Spreadsheets are made up of rectangular blocks called cells. A cell contains the data
you enter; from numbers to words to images to formulas, cells hold that information. You can
enter data either directly in the cell or in the formula bar (text box) for the cell right below
your ribbon.
You will also notice the name box (cell indicator) to the left of the formula bar. By default,
this displays the corresponding column and row for the cell. For instance, the cell in the top
left corner of the spreadsheet is A1 for column A, row 1.
In addition to calculations, you can use functions for things like counting the number of items
in a column or displaying a minimum or maximum number for a group of cells.
BUSHRA HAQ
2
LECTURE NOTES OF MICROSOFT EXCEL | BUITEMS
Here is a brief explanation of what each one is for and which button sections you can see.
File: Create a new workbook, open an existing one, save, print, and share books and
sheets.
Home: Ctrl the clipboard, font, alignment, numbers, style, cells, and editing.
Insert: Insert tables, charts, illustrations, filters, and links.
Draw: Use drawing tools such as a lasso selection, eraser, pen, and highlighter.
Page Layout: Adjust the spreadsheet theme, page setup, scale-to-fit, and sheet
options.
Formulas: Pick a formula, function from the library, and perform formula auditing.
Data: Get and transform data, view queries and connections, sort, filter, and use data
tools.
Review: Use tools for proofreading, accessibility, language, and comments.
View: Change the workbook view, items to show, zoom in or out, and work with
windows.
Also, note the TELL ME WHAT YOU WANT TO DO BOX. If you need help or want more
information on a feature, just enter the keyword into the box and view your results.
BUSHRA HAQ
3
LECTURE NOTES OF MICROSOFT EXCEL | BUITEMS
Spreadsheet Options
Managing a large number of spreadsheets is no problem for Excel. So, you can use more than
one if your project calls for it. For example, you can use different spreadsheets for months or
years, product warehouse locations, loan or credit card companies, and healthcare facilities.
Along with multiple sheets, you can take advantage of these basic spreadsheet features.
Add a spreadsheet: Click the plus button at the bottom next to your last sheet.
Rearrange spreadsheets: Hold the sheet tab and drag to its new spot in the
workbook.
Name a spreadsheet: Double-click the sheet tab and type the new name. By default,
you will see them named Sheet 1, Sheet 2, and so on.
Color a spreadsheet tab: Right-click the sheet tab and under Tab Color, just click to
apply a new one.
Protect a spreadsheet: Right-click the sheet tab and under Protect Sheet, add a
password and select your options.
BUSHRA HAQ
4
LECTURE NOTES OF MICROSOFT EXCEL | BUITEMS
Move or copy a spreadsheet: Right-click the sheet tab and select Move or Copy.
You can then move the sheet to another spot in the workbook, move it to a different
workbook, and make a copy of it for either case.
Delete a spreadsheet: Right-click the sheet tab and click Delete. You will need to
confirm this action in the subsequent pop-up window.
BUSHRA HAQ
5
LECTURE NOTES OF MICROSOFT EXCEL | BUITEMS
BUSHRA HAQ
6
LECTURE NOTES OF MICROSOFT EXCEL | BUITEMS
Another way to do this is to select the first one, hold down your Shift key, and then select the
last one. If you do this with cells, you can select an entire group across and down.
BUSHRA HAQ
7
LECTURE NOTES OF MICROSOFT EXCEL | BUITEMS
You can also simply hide (and unhide) columns or rows by selecting Hide (or Unhide) from
the context menu.
BUSHRA HAQ
8
LECTURE NOTES OF MICROSOFT EXCEL | BUITEMS
You can insert or delete a cell the same way as a column or row. However, with either option,
you will receive a pop-up alert asking how you would like to shift the cells, row, or column.
Just choose an option and click OK.
First, you select and right-click the column or row. In the context menu choose
either Column Width or Row Height, depending on which one you want to change. In the
pop-up window that appears, you will see the current width or height. Replace it with the
number you want and click OK.
BUSHRA HAQ
9
LECTURE NOTES OF MICROSOFT EXCEL | BUITEMS
Another way to adjust the size of a column or row is to first select it. Move your mouse to the
border until you see a two-sided arrow appear. Then, hold down your mouse button and drag
until you reach the size you want.
Then, move your mouse between two columns until you see the two-sided arrow and double-
click. Next, do the same for the rows. You will notice both columns and rows of the
spreadsheet adjust to fit the data in your cells. It will automatically adjust for the cell with the
longest amount of data.
BUSHRA HAQ
10
LECTURE NOTES OF MICROSOFT EXCEL | BUITEMS
Basic Formatting
Excel offers a variety of ways to format your spreadsheets, from basic to advanced. Since this
is a beginner’s guide, we will go through some simple formatting tips that you would likely
use.
No matter what you decide to use Excel for, basic formatting of columns, rows, and cells can
help you view your data easily. For instance, you may use the first row of a spreadsheet to
insert headers. Like in our example for a product sheet, you might use item number, product
name, and price.
To make that top row stand out better from a large amount of data beneath, you can format it
easily. Select the row and then apply your formatting using options on the Home tab. Here,
you may make the font bold, apply a fill shade, and color the font.
BUSHRA HAQ
11
LECTURE NOTES OF MICROSOFT EXCEL | BUITEMS
Keep in mind that these instructions will apply to the entire first row. If you only have a few
columns, you can follow the steps further above to only select certain cells in that row and
apply the formatting to them alone.
Dates
You may have a Date column on your spreadsheet for many reasons. When you enter the
data, when you make a purchase, or when an item is due are all just examples.
1. Select the column, row, or cell where you will enter the date.
2. Under Number on your ribbon, click the arrow in the General
3. Select either Short Date or Long Date from the dropdown box.
Note that if you use the Long Date, which inserts words and numbers as shown below, you
do not have to type it in manually. For instance, if you apply a Long Date and enter
“2/14/18” it will automatically populate as “Wednesday, February 14, 2018.”
BUSHRA HAQ
12
LECTURE NOTES OF MICROSOFT EXCEL | BUITEMS
Currency
If you have a spreadsheet for your budget, price list, or invoicing, then you can apply the
currency format easily in two different ways.
Method One
1. Select the column, row, or cell where you will enter the currency.
2. Under Number on your ribbon, click the arrow in the General
3. Select Currency from the dropdown box.
Method Two
The second method allows you to choose the type of currency you would like.
1. Select the column, row, or cell where you will enter the currency.
2. Under Number on your ribbon, click the arrow next to the Currency
3. Select the type of currency you wish to apply.
Whichever method you decide to use, any number that you enter into the applied columns,
rows, or cells will automatically be formatted as that currency.
BUSHRA HAQ
13
LECTURE NOTES OF MICROSOFT EXCEL | BUITEMS
Decimals
You can use the decimal formatting to adjust your currency or simple numbers. For instance,
you may be tracking your student’s grades or even your own where you need decimals. You
can apply this formatting with these two steps.
1. Select the column, row, or cell where you will enter the number.
2. Under Number on your ribbon, click either the Increase Decimal or Decrease
Decimal button depending on your current numbering format.
BUSHRA HAQ
14
LECTURE NOTES OF MICROSOFT EXCEL | BUITEMS
You will also notice under Number on your Home tab, many additional ways to format your
numbers. As you progress with Excel, these may come in handy.
These options include times, fractions, percentages, and others. Plus, you can click the More
number formats link at the bottom to see options like ZIP code, phone number, and custom
choices.
BUSHRA HAQ
15
LECTURE NOTES OF MICROSOFT EXCEL | BUITEMS
Cell Handles
First off, let me tell you about the various cell handles that Excel makes use of. You use a cell
handle by hovering the mouse on various parts of the screen. Fire up Excel and try this for
yourself. Nothing beats a little practice.
I’m going to show you this in Excel 2007, but only the most advanced options are version-
specific. You’ll be fine. One thing though. If you don’t use the default Windows mouse
cursors you might see different sorts of shapes. Change it back to the defaults until you get
the hang of this.
You already use this one, if you use a mouse at all. Hold the mouse anywhere within the
confines of a cell in a spreadsheet, and the mouse cursor becomes a small white cross. Hold
the left button down and drag the mouse to select all the cells you slide over, in a rectangular
shape. That’s it.
BUSHRA HAQ
16
LECTURE NOTES OF MICROSOFT EXCEL | BUITEMS
If you hold the mouse over the edge of a cell, then it behaves differently. It’s quite common
for people to do this by mistake, but it’s easy to avoid if you take a look at the cursor. It
should be a thin black cross with arrow-heads on it.
The move handle does exactly what you would think. It moves the current cell, or the current
block of cells if you have more than one selected. It’s smart though. If the cell you are
moving is referenced by formulae in other cells, each formula is automatically adjusted so
everything still works.
One safety tip. Make sure the cursor isn’t over the small black square in the bottom right
corner of the cell. You’ll be doing something completely different. I’ll explain that soon.
To copy cells instead of moving them, put the mouse in the same place, and hold down the
Control (Ctrl) key. The cursor changes back to a white arrow, with a small black cross beside
it.
The behavior is a little different now. If you drag the mouse to another location, the cell or
cells you have selected will be copied and pasted there. If the cell contains a formula, it will
change its references just the same as it would if you have used copy and paste. The contents
of the cell you are copying from will not be changed.
BUSHRA HAQ
17
LECTURE NOTES OF MICROSOFT EXCEL | BUITEMS
If you hold the mouse over the bottom right corner of the cell or cells selected, the cursor will
change to a simple black cross. That’s the Excel fill handle, and it does some cool stuff.
First off, if you have a formula in the cell, and you want to copy it to some adjacent cells, you
can do that.
What happens in this case is the same thing as you would have achieved with the copy
example further up. However, if the cells don’t contain formulae then the behavior is
different.
BUSHRA HAQ
18
LECTURE NOTES OF MICROSOFT EXCEL | BUITEMS
If the cells involved have a discernable pattern, then Excel will attempt to extend that pattern
as best it can.
So, imagine the above example again, but pretend, just for fun, that it contains 500 rows,
instead of the four shown. You’re suddenly required to apply numeric codes to the items” ¦
Create the first two, or however many are needed to establish a pattern. Hover over the fill
handle” ¦
“¦ and drag the cursor down over the next two (or 500) cells.
BUSHRA HAQ
19
LECTURE NOTES OF MICROSOFT EXCEL | BUITEMS
Note the indicator to the right of what the final number will be. Release the mouse.
That’s it. The series of numbers is extended down over the other cells. Note that all the cells
contain the actual values, not a formula.
You can use this for much more complex operations, none of which I have room for in this
post, including complex lists, custom lists, and copying a formatting pattern along with
the value pattern.
BUSHRA HAQ
20
LECTURE NOTES OF MICROSOFT EXCEL | BUITEMS
This uncomplicated formula tool can add, average, count numbers, or find the minimum or
maximum for a column, row, or group of cells. By default, you should see the AutoSum
button on your Home tab ribbon, all the way to the right. You can also access it from
the Formulas tab.
If you just click the AutoSum button, it will automatically insert the sum function. But if you
click the arrow for the button, you will see the other common formulas you can use
mentioned above.
Say that you have a column of numbers you would like to add. First, click the cell where you
would like the total to display. Next, click the AutoSum button. Excel will automatically
detect the numbers you want to add. They will be highlighted and you can see the formula
which may appear something like this: =SUM (C2:C7)
BUSHRA HAQ
21
LECTURE NOTES OF MICROSOFT EXCEL | BUITEMS
If this looks correct for you, just hit your Enter key. The calculation will pop into the cell
adding those numbers for you.
The other options within AutoSum work similarly. Maybe you need to get the average of a
group of cells. First, click the cell where you want the average to display. Next, click the
arrow for the AutoSum button. Again, Excel will automatically detect the numbers, highlight
the cells, and provide the formula. Click the Enter key to insert the average.
There are many formulas and functions that you can use. Some, like AutoSum, provide very
simple and commonly-used calculations. But many others are advanced and beyond the scope
of this beginner’s lectures of Microsoft Excel. Feel free to check them all out on
the Formulas tab if you like to experiment.
BUSHRA HAQ
22
LECTURE NOTES OF MICROSOFT EXCEL | BUITEMS
Summary
The Excel SUM function returns the sum of values supplied. These values can be numbers,
cell references, ranges, arrays, and constants, in any combination. SUM can handle up to 255
individual arguments.
Purpose
Add numbers together
Return value
The sum of values supplied.
Syntax
=SUM (number1, [number2], [number3], ...)
Arguments
number1 - The first value to sum.
BUSHRA HAQ
23
LECTURE NOTES OF MICROSOFT EXCEL | BUITEMS
Usage notes
The SUM function returns the sum of values supplied. These values can be numbers, cell
references, ranges, arrays, and constants, in any combination. SUM can handle up to 255
individual arguments.
Examples
In the example shown, the formula in D12 is:
References do not need to be next to one another. For example, to sum the cost of apples,
bananas, and kiwis only, you can use a formula like this:
The SUM function automatically ignores text values without returning an error. This can be
useful in situations like this, where the first instance of a formula would otherwise throw an
error. Excel provides a keyboard shortcut to automatically sum a range of cells above.
Notes
The SUM function sums values supplied as arguments (up to 255 arguments).
Arguments can be supplied as numbers, cell references, ranges, arrays, constants, and
results of other formulas or functions.
The SUM function automatically ignores text values.
BUSHRA HAQ
24
LECTURE NOTES OF MICROSOFT EXCEL | BUITEMS
Summary
SUMIF is a function to sum cells that meet a single criterion. SUMIF can be used to sum
cells based on dates, numbers, and text that match specific criteria. SUMIF supports logical
operators (>, <, <>, =) and wildcards (*,?) for partial matching.
Purpose
Sum numbers in a range that meet supplied criteria
Return value
The sum of values supplied.
Syntax
=SUMIF (range, criteria, [sum_range])
Arguments
range - The range of cells that you want to apply the criteria against.
sum_range - [optional] The cells to add together. If sum_range is omitted, the cells in
range are added together instead.
Usage notes
When sum_range is omitted, the cells in range will be summed.
Text criteria, or criteria that includes math symbols, must be enclosed in double
quotation marks (").
The wildcard characters? and * can be used in criteria. A question mark matches any
one character and an asterisk matches any sequence of characters.
BUSHRA HAQ
25
LECTURE NOTES OF MICROSOFT EXCEL | BUITEMS
To find a literal question mark or asterisk, use a tilde (~) in front question mark or
asterisk (i.e. ~?, ~*).
Summary
SUMIFS is a function to sum cells that meet multiple criteria. SUMIFS can be used to sum
values when adjacent cells meet criteria based on dates, numbers, and text. SUMIFS supports
logical operators (>, <, <>, =) and wildcards (*,?) for partial matching.
Purpose
Sum cells that match multiple criteria
Return value
The sum of the cells that meet all criteria
Syntax
=SUMIFS (sum_range, range1, criteria1, [range2], [criteria2], ...)
Arguments
sum_range - The range to be summed.
BUSHRA HAQ
26
LECTURE NOTES OF MICROSOFT EXCEL | BUITEMS
Usage notes
Excel's SUMIFS function sums cells in a range using supplied criteria. Unlike the SUMIF
function, SUMIFS can apply more than one set of criteria, with more than one range. The
first range is the range to be summed. The criteria are supplied in pairs (range/criteria) and
only the first pair is required. For additional criteria, supply an additional range/criteria pair.
Up to 127 range/criteria pairs are allowed.
Examples
In the first example, SUMIFS is configured to sum values in column F when the color in
column C is "red". In the second example, SUMIFS will sum values in column F only when
the color is "red" and the state is Texas (TX).
Notes
Each additional range must have the same number of rows and columns as
the sum_range.
Non-numeric criteria must be enclosed in double quotes, but numeric criteria does not
need quotes except with operators, i.e. ">32"
The wildcard characters ? and * can be used in criteria. A question mark matches any
one character and an asterisk matches any sequence of characters.
To find a literal question mark or asterisk, use a tilde (~) in front question mark or
asterisk (i.e. ~?, ~*).
BUSHRA HAQ
27
LECTURE NOTES OF MICROSOFT EXCEL | BUITEMS
SUMIF and SUMIFS can handle ranges, but not arrays. This means you can't use
other functions like YEAR on the criteria range, since the result is an array. If you
need this functionality, use the SUMPRODUCT function.
Summary
The Excel COUNT function returns the count of values that are numbers, generally cells that
contain numbers. Values can be supplied as constants, cell references, or ranges.
Purpose
Count numbers
Return value
A number representing a count of numbers.
BUSHRA HAQ
28
LECTURE NOTES OF MICROSOFT EXCEL | BUITEMS
Syntax
=COUNT (value1, [value2], ...)
Arguments
value1 - An item, cell reference, or range.
Usage notes
The COUNT function counts the number of numbers in supplied values. Values can be
items, cell references, or ranges. For example, =COUNT (1, 2, "apple") returns 2. And
COUNT (A1:A10) will count the number of numeric values in the range A1:A10.
Use COUNTA to include text and logical values. Use COUNTIF to count based on
criteria.
Error values or text values that cannot be coerced into numbers are not counted
BUSHRA HAQ
29
LECTURE NOTES OF MICROSOFT EXCEL | BUITEMS
Summary
COUNTIF is a function to count cells that meet a single criterion. COUNTIF can be used to
count cells with dates, numbers, and text that match specific criteria. The COUNTIF function
supports logical operators (>,<,<>,=) and wildcards (*,?) for partial matching.
Purpose
Count cells that match criteria
Return value
A number representing cells counted.
Syntax
=COUNTIF (range, criteria)
Arguments
range - The range of cells to count.
BUSHRA HAQ
30
LECTURE NOTES OF MICROSOFT EXCEL | BUITEMS
Usage notes
The COUNTIF function in Excel counts the number of cells in a range that match the
supplied criteria. Non-numeric criteria need to be enclosed in double quotes but numeric
criteria do not:
The wildcard characters ? and * can be used in criteria. A question mark matches any one
character and an asterisk matches any sequence of characters. To find a literal question mark
or asterisk, use a tilde (~) in front question mark or asterisk (i.e. ~?, ~*).
BUSHRA HAQ
31
LECTURE NOTES OF MICROSOFT EXCEL | BUITEMS
Summary
The Excel COUNTIFS function returns the count of cells that meet one or more criteria.
COUNTIFS can be used with criteria based on dates, numbers, text, and other conditions.
COUNTIFS supports logical operators (>, <, <>, =) and wildcards (*,?) for partial matching.
Purpose
Count cells that match multiple criteria
Return value
The number of times criteria are met
Syntax
=COUNTIFS (range1, criteria1, [range2], [criteria2], ...)
Arguments
range1 - The first range to evaluate.
Usage notes
COUNTIFS counts the number of cells in a range that match supplied criteria. Unlike the
COUNTIF function, COUNTIFS can apply more than one set of criteria, with more than one
range. Ranges and criteria are applied in pairs, and only the first pair is required. For each
additional criterion, you must supply another range/criteria pair. Up to 127 range/criteria
pairs are allowed.
BUSHRA HAQ
32
LECTURE NOTES OF MICROSOFT EXCEL | BUITEMS
Examples
With the example shown, COUNTIFS can be used to count records using 2 criteria as
follows:
Notes:
Each additional range must have the same number of rows and columns as range1, but
ranges do not need to be adjacent. If you supply ranges with a mismatch, you'll get a
#VALUE error.
Non-numeric criteria need to be enclosed in double quotes but numeric criteria do not.
For example: 100, "100", ">32", "jim", or A1 (where A1 contains a number).
The wildcard characters ? and * can be used in criteria. A question mark matches any
one character and an asterisk matches any sequence of characters.
To find a literal question mark or asterisk, use a tilde (~) in front question mark or
asterisk (i.e. ~?, ~*).
BUSHRA HAQ
33
LECTURE NOTES OF MICROSOFT EXCEL | BUITEMS
Summary
The Excel AVERAGE function returns the average of values supplied as multiple arguments.
AVERAGE can handle up to 255 individual arguments, which can include numbers, cell
references, ranges, arrays, and constants.
Purpose
Get the average of a group of numbers
Return value
A number representing the average.
Syntax
=AVERAGE (number1, [number2], ...)
Arguments
number1 - A number or cell reference that refers to numeric values.
BUSHRA HAQ
34
LECTURE NOTES OF MICROSOFT EXCEL | BUITEMS
Usage notes
1. The AVERAGE function returns the average (arithmetic mean) of a group of supplied
numbers.
2. To calculate the average, Excel adds the numbers together and divides by the total
number of numbers. For example, AVERAGE (2,4,6) returns 4.
Summary
The Excel AVERAGEIF function computes the average of the numbers in a range that meet
the supplied criteria. The criteria for AVERAGEIF supports logical operators (>,<,<>,=) and
wildcards (*,?) for partial matching.
Purpose
Get the average of numbers that meet criteria
BUSHRA HAQ
35
LECTURE NOTES OF MICROSOFT EXCEL | BUITEMS
Return value
A number representing the average.
Syntax
=AVERAGEIF (range, criteria, [average_range])
Arguments
range - One or more cells, including numbers or names, arrays, or references.
Usage notes
AVERAGEIF computes the average of the numbers in a range that meet the
supplied criteria. If average_range is not supplied, the cells in range are averaged.
If average_range is supplied, cells cells in average_range that correspond to cells
in range are averaged.
Notes:
Cells in range that contain TRUE or FALSE are ignored.
Average_range does not have to be the same size as range. The top left cell
in average_range is used as the starting point, and cells that correspond to cells
in range are averaged.
BUSHRA HAQ
36
LECTURE NOTES OF MICROSOFT EXCEL | BUITEMS
AVERAGEIF allows the wildcard characters question mark (?) and asterisk (*), in
criteria. The ? matches any single character and the * matches any sequence of
characters. To find a literal ? or *, use a tilde (~) before the character, i.e. ~* and ~?.
Summary
The Excel AVERAGEIFS function calculates the average of numbers in a range that meet
one or more supplied criteria. The criteria in AVERAGEIFS supports logical operators
(>,<,<>,=) and wildcards (*,?) for partial matching.
Purpose
Average cells that match multiple criteria
Return value
The average of the cells that meet all criteria
Syntax
=AVERAGEIFS (avg_rng, range1, criteria1, [range2], [criteria2], ...)
BUSHRA HAQ
37
LECTURE NOTES OF MICROSOFT EXCEL | BUITEMS
Arguments
avg_rng - The range to average.
Usage notes
The AVERAGEIFS function can calculate an average based on more than one criteria. The
first range given to AVERAGEIFS is the range containing numbers to average. Criteria are
supplied in pairs [range, criteria] and only the first pair is required. For each additional
criteria, supply another range/criteria pair. The criteria given to AVERAGEIFS are applied
with AND logic. Data must meet all criteria to be included in the average. Criteria can
include wildcards.
Examples
To average values in A1:A10, where B1:B10 = "A", and C1:C10 > 5, you can use:
=AVERAGEIFS(A1:A10,B1:B10,"A",C1:C10,">5")
=AVERAGEIFS(prices,prices,">0",prices,"<500000")
=AVERAGEIFS(prices,beds,">=2",baths,">1")
=AVERAGEIFS(prices,prices,">0")
where "prices" (C6:C15), "beds" (D6:D15), and "baths" (E6:E15) are named ranges.
Note: the order of arguments is different between the AVERAGEIFS and AVERAGEIF
functions. The range to average is the first argument in AVERAGEIFS, but
the third argument in AVERAGEIF.
BUSHRA HAQ
38
LECTURE NOTES OF MICROSOFT EXCEL | BUITEMS
Notes
If no data matches criteria, AVERAGEIFS returns the #DIV0! error
Each additional range must have the same number of rows and columns as
the avg_range.
Non-numeric criteria need to be enclosed in double quotes but numeric criteria do not.
For example: 100, "100", ">32", "jim", or A1 (where A1 contains a number).
The wildcard characters ? and * can be used in criteria. A question mark matches any
one character and an asterisk matches any sequence of characters.
To find a literal question mark or asterisk, use a tilde (~) in front question mark or
asterisk (i.e. ~?, ~*).
BUSHRA HAQ
39
LECTURE NOTES OF MICROSOFT EXCEL | BUITEMS
Summary
VLOOKUP is an Excel function to lookup and retrieve data from a specific column in table.
VLOOKUP supports approximate and exact matching, and wildcards (* ?) for partial
matches. The "V" stands for "vertical". Lookup values must appear in the first column of the
table, with lookup columns to the right.
Purpose
Lookup a value in a table by matching on the first column
Return value
The matched value from a table.
Syntax
=VLOOKUP (value, table, col_index, [range_lookup])
Arguments
value - The value to look for in the first column of a table.
Usage notes
VLOOKUP is designed to retrieve data in a table organized into vertical rows, where each
row represents a new record. The "V" in VLOOKUP stands for vertical:
BUSHRA HAQ
40
LECTURE NOTES OF MICROSOFT EXCEL | BUITEMS
VLOOKUP requires a lookup table with lookup values in the left-most column. The data you
want to retrieve (result values) can appear in any column to the right:
When you use VLOOKUP, imagine that every column in the table is numbered, starting from
the left. To get a value from a particular column, simply supply the appropriate number as the
"column index":
BUSHRA HAQ
41
LECTURE NOTES OF MICROSOFT EXCEL | BUITEMS
=VLOOKUP(H3,B4:E13,2,FALSE) // first
=VLOOKUP(H3,B4:E13,3,FALSE) // last
=VLOOKUP(H3,B4:E13,4,FALSE) // email
VLOOKUP has two modes of matching: exact and approximate, which are controlled by the
4th argument, called "range_lookup". Set range_lookup to FALSE to force exact matching,
and TRUE for approximate matching.
BUSHRA HAQ
42
LECTURE NOTES OF MICROSOFT EXCEL | BUITEMS
The formula in H6 to lookup year based on an exact match of movie title is:
BUSHRA HAQ
43
LECTURE NOTES OF MICROSOFT EXCEL | BUITEMS
Note: your data must be sorted in ascending order by lookup value when you use
approximate match mode with VLOOKUP.
Other notes
Range_lookup controls whether value needs to match exactly or not. The default is
TRUE = allow non-exact match.
If range_lookup is TRUE (the default setting), a non-exact match will cause the
VLOOKUP function to match the nearest value in the table that is still less
than value.
If range_lookup is TRUE (the default setting) make sure that lookup values in the
first row of the table are sorted in ascending order. Otherwise, VLOOKUP may return
an incorrect or unexpected value.
BUSHRA HAQ
44