Unit 3
Unit 3
3.1 Objectives
3.2 Introduction
3.3 Calculation formulae
3.3.1 Addition, AutoSum
3.3.2 Multiplication
3.4 Date functions
3.4.1 TODAY function
3.4.2 DATE function
3.5 Inserting formulae and functions in the worksheet
3.6 Cell reference
3.7 Paste Function
3.8 VLOOKUP function
3.9 HLOOKUP function
3.10 Summary
3.11 Solutions to Check your Progress
3.12 List of further Readings
3.1 OBJECTIVES
Microsoft Excel is an electronic spreadsheet program that can be used for storing,
organizing and manipulating data and performing statistical analysis. When we look at
the Excel screen we see a rectangular table or grid of rows and columns. The horizontal
rows are identified by numbers (1, 2, 3) and the vertical columns with letters of the
alphabet (A, B, C). For columns beyond 26, columns are identified by two or more letters
such as AA, AB, and AC. The intersection point between a column and a row is a small
rectangular box known as a cell. A cell is the basic unit for storing data in the
spreadsheet. Because an Excel spreadsheet contains thousands of these cells, each is
given a cell reference or address to identify it. The cell reference is a combination of the
column letter and the row number such as A3, B6, and AA345. The types of data that a
cell can hold include numbers, text or formulas. Just as in math class, formulas are used
for calculations usually involving data contained in other cells. Excel and other electronic
spreadsheets include a number of built in formulas used for common tasks known as
functions.
The basic idea behind this unit is to acquaint the learner with the simple concepts in
Microsoft Excel for performing day to day business activities. Herein, we would learn the
difference between a formula and a function. Then we would learn to apply both the
elements in a spreadsheet. Mainly, we would focus on functions for addition,
multiplication, date manipulations, cell referencing and lookup functions.
3.3.1 Addition
Microsoft Excel allows us to add numbers as we type them into a cell. For example, we
may type =15+20 in a cell to display the result 35.
To add all numbers in a contiguous row or column, we can use ‘AutoSum’. This can be
done by clicking a cell below the column of numbers or to the right of the row of
numbers and then by clicking AutoSum on the Standard toolbar, and pressing ENTER.
To add numbers that are not in a contiguous row or column, we can use the SUM
function.
Click Here
Check the
Result
Similarly, elements of a row can also be added. Now to understand SUM function we
will take another example but first we look at its Syntax:
SYNTAX:
SUM(number1,number2, ...)
Number1, number2, ... are 1 to 30 arguments for which you want the total value or sum.
Observations:
• Numbers, logical values, and text representations of numbers that you type
directly into the list of arguments are counted. See the first and second examples
following.
• If an argument is an array or reference, only numbers in that array or reference are
counted. Empty cells, logical values, text, or error values in the array or reference
are ignored. See the third example following.
• Arguments that are error values or text that cannot be translated into numbers
cause errors.
Example #2
To add the values of cells B3, B4, B5 and B7, we can put the formula as shown:
Explanations:
Formula Illustration
Adds 2 contiguous values from B2 and B3,
=SUM(B2:B3, B5)
and one from B5.
Adds individual marks of Anurag, Hemant
=SUM(B2,B5,B7)
and Lalit.
We can use the SUMIF function to create a total value for one range based on a value in
another range, as in the following example.
SYNTAX:
SUMIF(range,criteria,sum_range)
Criteria is the criteria in the form of a number, expression, or text that defines which
cells will be added. For example, criteria can be expressed as 32, "32", ">32", "apples".
• The cells in sum_range are summed only if their corresponding cells in range
match the criteria.
• If sum_range is omitted, the cells in range are summed.
• Microsoft Excel provides additional functions that can be used to analyze your
data based on a condition. For example, to count the number of occurrences of a
string of text or a number within a range of cells, use the COUNTIF function. To
have a formula return one of two values based on a condition, such as a sales
bonus based on a specified sales amount, use the IF function.
Example #3
Microsoft Excel allows us to type =5*10 in a cell to display the result 50. Whereas, to
multiply a range of numbers by a number, we need to follow the following steps:
Important This procedure replaces the numbers in the range with the result of the
multiplication.
To multiply numbers in different cells using a formula we can use the asterisk (*)
operator or the PRODUCT function.
Explanation:
Formula Illustration
=A2*A3 Multiplies the numbers in the first two cells
=PRODUCT(A2:A4) Multiplies all the numbers in the range
Multiplies all the numbers in the range, and
=PRODUCT(A2:A4,2)
2
PRODUCT
This function multiplies all the numbers given as arguments and returns the product.
SYNTAX:
PRODUCT(number1,number2,...)
Observations:
3.4.1 TODAY
In Microsoft Excel, ‘TODAY ()’ returns the serial number of the current date. The serial
number is the date-time code used by Microsoft Excel for date and time calculations. If
the cell format was General before the function was entered, the result is formatted as a
date.
Syntax
=TODAY ( )
Observations:
Excel stores dates as sequential serial numbers so they can be used in calculations. By
default, January 1, 1900 is serial number 1, and January 1, 2008 is serial number 39448
because it is 39,448 days after January 1, 1900.
Example: #5
The function returns the sequential serial number that represents a particular date. If the
cell format was General before the function was entered, the result is formatted as a date.
Syntax:
Year: The year argument can be one to four digits. Microsoft Excel interprets the year
argument according to the date system you are using. By default, Excel for Windows uses
the 1900 date system; Excel for the Macintosh uses the 1904 date system.
• If year is between 0 (zero) and 1899 (inclusive), Excel adds that value to 1900 to
calculate the year. For example, DATE (108, 1, 2) returns January 2, 2008
(1900+108).
• If year is between 1900 and 9999 (inclusive), Excel uses that value as the year.
For example, DATE (2008, 1, 2) returns January 2, 2008.
• If year is less than 0 or is 10000 or greater, Excel returns the #NUM! error value.
• If year is between 4 and 1899 (inclusive), Excel adds that value to 1900 to
calculate the year. For example, DATE (108, 1, 2) returns January 2, 2008
(1900+108).
• If year is between 1904 and 9999 (inclusive), Excel uses that value as the year.
For example, DATE (2008, 1, 2) returns January 2, 2008.
• If year is less than 4 or is 10000 or greater or if year is between 1900 and 1903
(inclusive), Excel returns the #NUM! error value.
Month: Month is a number representing the month of the year. If month is greater than
12, month adds that number of months to the first month in the year specified. For
example, DATE (2008, 14, 2) returns the serial number representing February 2, 2009.
Day: Day is a number representing the day of the month. If day is greater than the
number of days in the month specified, day adds that number of days to the first day in
the month. For example, DATE (2008, 1, 35) returns the serial number representing
February 4, 2008.
Observations:
• Excel stores dates as sequential serial numbers so they can be used in calculations.
By default, January 1, 1900 is serial number 1, and January 1, 2008 is serial
number 39448 because it is 39,448 days after January 1, 1900
• The DATE function is most useful in formulas where year, month, and day are
formulas, not constants.
Check your progress 2
a. If the cell format was ________ before the TODAY function was entered,
the result is formatted as a date.
b. The DATE function is most useful in formulas where year, month, and
day are formulas, not _________.
Formulas are equations that perform calculations on values in our worksheet. A formula
starts with an equal sign (=). For example, the following formula multiplies 2 by 3 and
then adds 5 to the result.
=5+2*3
The following formulas contain relative references to and names of other cells. The cell
that contains the formula is known as a dependent cell when its value depends on the
values in other cells. For example, cell B2 is a dependent cell if it contains the formula
=C2.
Example Illustration
=C2 Uses the value in the cell C2
=Sheet2!B2 Uses the value in cell B2 on Sheet2
=Asset-Liability Subtracts a cell named Liability from a cell named Asset
Steps to enter a formula:
Observations:
• We can enter the same formula into a range of cells by selecting the range first,
typing the formula, and then pressing CTRL+ENTER.
• If we are familiar with the arguments of a function, we may use the function
tooltip that appears after we type the function name and an opening parenthesis.
Then we may click the function name to view the Help topic on the function, or
click an argument name to select the corresponding argument in our formula.
3.6 CELL REFERENCE
A reference identifies a cell or a range of cells on a worksheet and tells Microsoft Excel
where to look for the values or data we want to use in a formula. With references, we can
use data contained in different parts of a worksheet in one formula or use the value from
one cell in several formulas. We can also refer to cells on other sheets in the same
workbook, and to other workbooks. References to cells in other workbooks are called
links.
By default, Excel uses the A1 reference style, which refers to columns with letters (A
through IV, for a total of 256 columns) and refers to rows with numbers (1 through
65536). These letters and numbers are called row and column headings. To refer to a cell,
we need to enter the column letter followed by the row number. For example, B2 refers to
the cell at the intersection of column B and row 2.
To refer to Use
The cell in column A and row 10 A10
The range of cells in column A and rows 10 through 20 A10:A20
The range of cells in row 15 and columns B through E B15:E15
All cells in row 5 5:5
All cells in rows 5 through 10 5:10
All cells in column H H:H
All cells in columns H through J H:J
The range of cells in columns A through E and rows 10 through 20 A10:E20
Types of references:
Relative references: A relative cell reference in a formula, such as A1, is based on the
relative position of the cell that contains the formula and the cell the reference refers to. If
the position of the cell, that contains the formula changes, the reference is changed. If we
copy the formula across rows or down columns, the reference automatically adjusts. By
default, new formulas use relative references.
Example #6
If we copy a relative reference in cell B2 to cell B3, it automatically adjusts from =A1 to
=A2.
Here, we have given a formula, =A1 in cell B1.
Example #7
If we copy an absolute reference in cell B2 to cell B3, it stays the same in both cells
=$A$1. Here, we have given a formula, =$A$1 in cell B1.
When, we drag the formula down through B2 to B5 as:
Example: If we copy a mixed reference from cell A2 to B3, it adjusts from =A$1 to
=B$1.
1. Make sure that the Microsoft Office Clipboard is displayed in the task pane of any
open Office program or the Collect Without Showing Office Clipboard option
is turned on.
1. If the Microsoft Office Clipboard is not displayed in the task pane, click Office
Clipboard on the Edit menu.
2. Click where items need to be pasted. We can paste collected items into any
Microsoft Office program.
3. We can do one of the following:
• To paste items one at a time, on the Office Clipboard, click each item to
be pasted.
• To paste all the copied items, we can click Paste All on the Office
Clipboard task pane.
VLOOKUP is a function in Microsoft Excel that searches for a value in the leftmost
column of a table, and then returns a value in the same row from a column we specify in
the table. Use VLOOKUP instead of HLOOKUP when your comparison values are
located in a column to the left of the data you want to find.
The V in VLOOKUP stands for "Vertical."
SYNTAX
VLOOKUP(lookup_value,table_array,col_index_num,range_lookup)
Lookup_value is the value to be found in the first column of the array. Lookup_value
can be a value, a reference, or a text string.
Table_array is the table of information in which data is looked up. Use a reference to a
range or a range name, such as Database or List.
• If range_lookup is TRUE, the values in the first column of table_array must be
placed in ascending order: ..., -2, -1, 0, 1, 2, ..., A-Z, FALSE, TRUE; otherwise
VLOOKUP may not give the correct value. If range_lookup is FALSE,
table_array does not need to be sorted.
• You can put the values in ascending order by choosing the Sort command from
the Data menu and selecting Ascending.
• The values in the first column of table_array can be text, numbers, or logical
values.
• Uppercase and lowercase text are equivalent.
Col_index_num is the column number in table_array from which the matching value
must be returned. A col_index_num of 1 returns the value in the first column in
table_array; a col_index_num of 2 returns the value in the second column in table_array,
and so on. If col_index_num is less than 1, VLOOKUP returns the #VALUE! error value;
if col_index_num is greater than the number of columns in table_array, VLOOKUP
returns the #REF! error value.
Observations:
• If VLOOKUP can't find lookup_value, and range_lookup is TRUE, it uses the
largest value that is less than or equal to lookup_value.
• If lookup_value is smaller than the smallest value in the first column of
table_array, VLOOKUP returns the #N/A error value.
• If VLOOKUP can't find lookup_value, and range_lookup is FALSE, VLOOKUP
returns the #N/A value.
=VLOOKUP(ItemToFind,RangeToLookIn,ColumnToPickFrom,SortedOrUnsorted)
The RangeToLookIn is the range of data with the row headings at the left hand side.
The ColumnToPickFrom is how far across the table the function should look to pick
from.
The Sorted/Unsorted is whether the column headings are sorted. TRUE for yes, FALSE
for no.
Explanations:
Formula Interpretation
Looks up 1 in column A, and returns the value
=VLOOKUP(1,A2:C10,2)
from column B in the same row (2.17)
Looks up 1 in column A, and returns the value
=VLOOKUP(1,A2:C10,3,TRUE)
from column C in the same row (100)
Looks up 0.746 in column A. Because there is no
=VLOOKUP(.7,A2:C10,3,FALSE) exact match in column A, an error is returned
(#N/A)
Looks up 0.1 in column A. Because 0.1 is less than
=VLOOKUP(0.1,A2:C10,2,TRUE) the smallest value in column A, an error is returned
(#N/A)
Looks up 2 in column A, and returns the value
=VLOOKUP(2,A2:C10,2,TRUE)
from column B in the same row (1.71)
Example #8
And after entering the formula, we get the result 2.17 as shown below:
3.9 HLOOKUP FUNCTION
HLOOKUP is a function in Microsoft Excel that searches for a value in the top row of a
table and then returns a value in the same column from a row that is specified in the table.
We use HLOOKUP when the comparison values are located in a row across the top of a
table of data, and we want to look down a specified number of rows.
This function scans across the column headings at the top of a table to find a specified
item. When the item is found, it then scans down the column to pick a cell entry.
SYNTAX
=HLOOKUP(ItemToFind,RangeToLookIn,RowToPickFrom,SortedOrUnsorted)
The RangeToLookIn is the range of data with the column headings at the top. This is a
Table_array i.e a table of information in which data is looked up.
• The values in the first row of table_array can be text, numbers, or logical values.
• If SortedOrUnsorted is TRUE, the values in the first row of table_array must be
placed in ascending order: ...-2, -1, 0, 1, 2,... , A-Z, FALSE, TRUE; otherwise,
HLOOKUP may not give the correct value. If SortedOrUnsorted is FALSE,
table_array does not need to be sorted.
• Uppercase and lowercase texts are equivalent.
The RowToPickFrom is how far down the column the function should look to pick
from.
The Sorted/Unsorted is whether the column headings are sorted. TRUE for yes, FALSE
for no.
Observations:
And after entering the formula, we get the result 19 as shown below:
Example #10
And after entering the formula, we get the result ‘c’ as shown below:
Explanations:
Formulae and functions are the core part of mathematical, statistical as well as financial
calculations. MS Excel makes the things easy to use and incorporate the functional
aspects of any sort of computations. We would also study about tables and graphs in the
upcoming units where again we would learn to apply the formulae as the need be. The
main functions covered in this unit are HLOOKUP and VLOOKUP. HLOOKUP is a
function in Microsoft Excel that searches for a value in the top row of a table and then
returns a value in the same column from a row that is specified in the table. VLOOKUP
is a function in Microsoft Excel that searches for a value in the leftmost column of a
table, and then returns a value in the same row from a column we specify in the table. We
have also learned in this unit about the DATE and TODAY functions along with SUM
and PRODUCT. Functions relating to DATE help us compute days between given dates
and are used mainly in interest calculating activities and salary calculations. SUM and
PRODUCT functions are used in day to day calculations and computations.
Q.1 Vertical
Q.2 a. Reference b. Approximate
Q.3 a. True b. False
3.12 LIST OF FURTHER READINGS