Professional Documents
Culture Documents
4.lab Exercises 3
4.lab Exercises 3
FORMATTING OF LETTERS
DATE:
DATE:
DATE:
Aim:
To Create a mail merge to send a letter one or more members.
Mail merge is a feature within most data processing applications that enables users to send a
similar letter or document to multiple recipients. It enables connecting a single form template
with a data source that contains information about the recipient’s name, address and other
predefined and supported data.
Procedure:
Step 1: Open MS-Word by click on START button; go to All Programs, then select Microsoft
Office Word 2007.
Step 2: To open a new document, Click on Office Button then select New - > Blank Document
then click on create option.
Step 3: Click Mailing Start mail mergeLetters
Step 4: Select “Mailings” from “Tools‟ menu. Then click on “Start Mail Merge” option then
select “step by step Mail merge wizard…” Then Mail merge dialog box appears on the right
side of the screen.
Step 5:
1. Select the Letter Type as “Letters” Radio button from “Select document type list. Click on”
Next:Starting document”.
2. Select the “Use the current document “radio button from the “select starting document “list.
3. click Mailing Select RecipientsType New List / Use existing List
4. click Mailing Select RecipientsType New List Customizing
ColumnsCustomizing address list click Add/Delete/Rename buttonClick OK
5. Select “Type a new list” radio button from “select recipients “list .Then click on “create”.
Then a new dialogue box “New address list” appears. Then enter address information for 10
entries. Then click on “OK”. Then click on “save “. Then 10 entries list will appear, select
needed ones. Then press on “OK”.
6. Click Savefilename.mdb(Ex. Mailmerge.mdb).
7. Click MailingInsert Merge fieldsinsert the recipient list in your letter.
8. Click Finish & Merge ButtonComplete the Mail merge
9. Select “Edit individual letters…” then select “All” Radio button then click “OK”, to edit any
of the address if needed.
10. All the recipient addresses are individually displayed all individual letters.
Step 6: At last we have to save the file as “Mail Merge.docx” by clicking on: “Save” button from
“Office” button.
Step 8: Finally Close and Exit the Word document
Result :
The Word document is create and manipulate the mail merge and displayed the output
successfully.
FAS price quotation = Loco price quotation + cost of carriage of goods upto the harbour
nearest to the seller.
SUM
To sum a range of cells, use the SUM function.
SUMIF
To sum cells based on one criteria (for example, greater than 9), use the following SUMIF
function (two arguments).
To sum cells based on one criteria (for example, green), use the following SUMIF function (three
arguments, last argument is the range to sum).
COUNTIF
To count cells based on one criteria (for example, greater than 9), use the following COUNTIF
function.
Note: visit our page about the COUNTIF function for many more examples.
AVERAGE
To calculate the average number of cells that contain numbers, use the AVERAGE function.
CONCATENATE
Dataset Information: Information contains First name and Last name
First name Last name
Susan Chang
Ayako Tanaka
Bobby Smith
Aaron Lennox
Q1: Combine First name and Last name in to one column called Full name with space b/w the
names
Procedure:
Step 1: Create one column called Full name in Cell D5
Step 2: Enter the following formula =CONCATENATE(B6," ",C6) in the Cell D6 and Press Enter
Step 3: Go to the end of Cell D6 and drag the formula till Cell D9
FIND
Dataset:
What to Find Within Result
the The cat in the Hat
Scenario: Find the text “the” in Within the Column using FIND Function
Note: - There are 2 strings with the text “the” in the Within Column. One with lower case and
another with T letter as capital
Procedure:
Step 1: Enter the following formula in the Cell D7 and Press Enter=FIND(B7,C7)
Note:- Start number parameter is optional and defaults to 1. The value 12 is returned which is
the position of the string “the” in the text C7
REPLACE
Dataset:
What to Replace Within Result
My The cat in the Hat
Scenario: Replace the text “the” with the “My” text using REPLACE Function
Note: - There are 2 strings with the text “the” in the Within Column. One with lower case and
another with T letter as capital
Procedure:
Step 1: Enter the following formula in the Cell D7 and Press Enter
=REPLACE(C7,1,3,B7)
The above formula will replace the first “The” with “My” text because starting number as we
mentioned in the formula is 1
Step 3: If you want to replace the second “the” with “My “ text, use the following
formula=REPLACE(C7,12,3,B7).
In the above formula, the starting number we mentioned as 12 which is the starting position of
the second “the” text in the Cell C7
SUBSTITUTE
Dataset:
Address Formatted Address
John Smith, 1234 Main St.
Anywhere, CA 10134
Scenario: Formatting the address (Substituting the comma with new line character) using
SUBSTITUTE Function
Step 1: Enter the following formula in the Cell C7 and Press Enter
=SUBSTITUTE(B7,",", CHAR(10))
The Commas are removed and substituted with new line character using Char(10) Function
EXACT
Dataset:
Text1 Text2 Result
Apple Apple
Orange orange
Scenario: Check whether Text1 and Text2 are equal. If equal, return TRUE. If not equal, return
FALSE
Note: Exact Formula is case sensitive.
Procedure:
Step 1: Enter the following formula in the Cell E7 and Press Enter
=EXACT(C7,D7)
Case Study
Dataset
City
Los Angels
Sedona
Elmira
Lackawana
Defiance
Syntax:
=VLOOKUP(lookup_value, table_array, row_index_num, [range_lookup])
HLOOKUP:
Use HLOOKUP when your comparison values are located in a row across the top of a table of
data, and you want to look down a specified number of rows. Use VLOOKUP when your
comparison values are located in a column to the left of the data you want to find.
The H in HLOOKUP stands for "Horizontal."
Syntax
=HLOOKUP(lookup_value, table_array, row_index_num, [range_lookup])
The HLOOKUP function syntax has the following arguments:
1. Lookup_value (Required). The value to be found in the first row of the table.
Lookup_value can be a value, a reference, or a text string.
2. Table_array (Required). A table of information in which data is looked up. Use a
reference to a range or a range name.
3. The values in the first row of table_array can be text, numbers, or logical values.
4. If range_lookup 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 range_lookup is FALSE, table_array does not need to be sorted.
VLOOKUP
Dataset Information: Product Sales Information in $ during the period January to June
Product Januar Februar March April May June
Product1 $813.00 $909.00 $753.00 $388.00 $361.00 $748.00
Name y y
Product2 $889.00 $452.00 $826.00 $530.00 $742.00 $104.00
Product3 $243.00 $766.00 $397.00 $14.00 $232.00 $878.00
Product4 $895.00 $949.00 $214.00 $616.00 $167.00 $286.00
Product5 $864.00 $382.00 $57.00 $402.00 $431.00 $489.00
Product6 $779.00 $389.00 $895.00 $328.00 $280.00 $905.00
Scenario: If you want to find the April Sales for the particular product, we can use vlookup
function
Note:-1. If the data is vertical, use vlookup
2. If the data is horizontal, use hlookup
3. Make sure that your dataset range and formula range must be same
Procedure:
Step 1: Type the Column Name “Product Name” in Cell L5 and Column Name “April” in Cell
M5
Step 2: Enter the following formula in the Cell M6 and Press Enter
=VLOOKUP(L6,$C$3:$I$9,5,FALSE)
Step 3: If you enter Product1 in Cell L6, Excel will calculate the corresponding April Sales for
that product
Step 4: If you change the product name in cell L6 (Eg: Product3 or Product5), the corresponding
April Sales values ($14.00 or $402.00) is searched using vlookup formula
HLOOKUP
Dataset Information: Product Sales Information in $ during the period January to June
(Horizontal Data)
Product Product1 Product2 Product3 Product4 Product5 Product6
January
Name 813 889 243 895 864 779
February 909 452 766 949 382 389
March 753 826 397 214 57 895
April 388 530 14 616 402 328
May 361 742 232 167 431 280
June 748 104 878 286 489 905
Scenario: If you want to find the April Sales for the particular product, we can use hlookup
function
Note:-1. If the data is vertical, use vlookup
2. If the data is horizontal, use hlookup
3. Make sure that your dataset range and formula range must be same
Procedure:
Step 1: Type the Column Name “Product Name” in Cell L5 and Column Name “April” in Cell
L6
Step 2: Enter the following formula in the Cell M6 and Press Enter
=HLOOKUP(M5,$C$5:$I$11,5,FALSE)
Step 3: If you enter Product1 in Cell M5, Excel will calculate the corresponding April Sales for
that product
Step 4: If you change the product name in cell M5 (Eg: Product3 or Product5), the
corresponding April Sales values ($14.00 or $402.00) is searched using hlookup formula
Case Study
1. Dataset: ProductID with Price
ProductID Price
A134 $ 3.50
B242 $ 4.20
X212 $ 4.80
C413 $ 5.00
B2211 $ 5.20
Q1: Write VLOOKUP Formula to find the price for a particular product using ProductID
2. Dataset: ProductID with Price
Product
ID A134 B242 X212 C413 B2211
Price $3.50 $4.20 $4.80 $5.00 $5.20
Q1: Write HLOOKUP Formula to find the price for a particular product using ProductID
EX NO:7 CREATING DIFFERENT TYPE OF CHARTS IN EXCEL
DATE:
In Microsoft Excel, a chart is often called a graph. It is a visual representation of data from a
worksheet that can bring more understanding to the data than just looking at the numbers.
A chart is a powerful tool that allows you to visually display data in a variety of different chart
formats such as Bar, Column, Pie, Line, Area, Doughnut, Scatter, Surface, or Radar charts. With
Excel, it is easy to create a chart.
Here are some of the types of charts that you can create in Excel.
What is a Bar Chart?
A bar chart is a graph that shows horizontal bars with the axis values for the bars displayed on
the bottom of the graph.
It is a graphical object used to represent the data in your Excel spreadsheet.
You can use a bar chart when:
You want to compare values across categories.
The category text is long and difficult to display in a column chart.
You want to show duration in a graph.
Steps to Create a Bar Chart
To create a bar chart in Excel 2007, you will need to do the following steps:
1. Highlight the data that you would like to use for the bar chart. In this example, we have
selected the range A1:C5.
2. Select the Insert tab in the toolbar at the top of the screen. Click on the Bar button in the
Charts group and then select a chart from the drop down menu. In this example, we
have selected the first bar chart (called Clustered Bar) in the 2-D Column section.
3. Now you will see the bar chart appear in your spreadsheet with horizontal bars to
represent both the shelf life and restock time for each product. The shelf life (in days) is
displayed as red horizontal bars and the restock time (in days) is displayed as blue
horizontal bars. You can see the axis values on the bottom of the graph for these
horizontal bars.
4. Finally, let's add a title for the bar chart. By default, your chart will be created without a
title in Excel 2007.
To add a title, select the Layout tab under Chart Tools in the toolbar at the top of the
screen (Chart Tools will only appear when you have the chart selected). Click on the Chart
Title button in the Labels group and then select "Above Chart" from the drop down
menu.
5. Now you should see a title appear at the top of the chart area. Click on the title and it
will become editable. Enter the text that you would like to see as the title. In this tutorial,
we have entered "Product Life (in Days)" as the title for the bar chart.
What is a Column Chart?
A column chart is a graph that shows vertical bars with the axis values for the bars displayed on
the left side of the graph.
It is a graphical object used to represent the data in your Excel spreadsheet.
You can use a column chart when:
You want to compare values across categories.
3. Now you will see the column chart appear in your spreadsheet with rectangular bars to
represent both the sales and the expense numbers. The sales values are displayed as blue
vertical bars and the expenses are displayed as red vertical bars. You can see the axis
values on the left side of the graph for these vertical bars.
4. Finally, let's add a title for the column chart. By default, your chart will be created
without a title in Excel 2007.
To add a title, select the Layout tab under Chart Tools in the toolbar at the top of the
screen (Chart Tools will only appear when you have the chart selected). Click on the Chart
Title button in the Labels group and then select "Above Chart" from the drop down
menu.
Now you should see a title appear at the top of the chart area. Click on the title and it
will become editable. Enter the text that you would like to see as the title. In this tutorial,
we have entered "Sales and Expenses" as the title for the column chart.
What is a Pie Chart?
A pie chart is a circle that is divided into slices and each slice represents a proportion of the
whole.
It is a graphical object used to represent the data in your Excel spreadsheet that uses 1 series of
data to create the graph.
You can use a pie chart when:
You want to show numbers as a proportion of the whole (ie: the numbers equal 100%).
There are a limited number of pie slices. If there are too many pie slices, then a pie chart
is not a recommended graph to use.
3. Now you will see the completed pie chart. In this tutorial, the pie chart has 4 slices (one
for each division). Each slice represents the sales as a percentage of the total sales.
What is a Line Chart?
A line chart is a graph that shows a series of data points connected by straight lines.
It is a graphical object used to represent the data in your Excel spreadsheet.
You can use a line chart when:
You want to show a trend over time (such as days, months or years). In this case, the
time values would be your categories.
The order of your categories (ie: time values) is important.
Steps to Create a Line Chart
To create a line chart in Excel 2007, you will need to do the following steps:
1. Highlight the data that you would like to use for the line chart. In this example, we have
selected the range A1:D7.
2. Select the Insert tab in the toolbar at the top of the screen. Click on the Line button in
the Charts group and then select a chart from the drop down menu. In this example, we
have selected the fourth line chart (called Line with Markers) in the 2-D Line section.
3. Now you will see the line chart appear in your spreadsheet showing the trend for 3
products (ie: Desktops, Laptops and Tablets). The blue series of data points represents
the trend for Desktops, the red series of data points represents Laptops and the green
series of data points represents Tablets.
The axis values for each product are displayed on the left side of the graph.
4. Finally, let's add a title for the line chart. By default, your chart will be created without a
title in Excel 2007.
To add a title, select the Layout tab under Chart Tools in the toolbar at the top of the
screen (Chart Tools will only appear when you have the chart selected). Click on the Chart
Title button in the Labels group and then select "Above Chart" from the drop down
menu.
Now you should see a title appear at the top of the chart area. Click on the title and it
will become editable. Enter the text that you would like to see as the title. In this tutorial,
we have entered "Product Trends by Month" as the title for the line chart.
Step 3: Click the Dropdown next to Sum(Yearly…) and Select Value Field Settings in ΣValues
Step 4: Change the sum function to average function in the value field settings dialog box
Step 5: Click Ok
Note: To Remove the Inserted Fields, Click the Dropdown Option and Select Remove Field
Question 2: How many number of male and female in each state and draw a chart?
Step 1: From the Pivot Table Fields List, Drag the Sex Field to Row Labels
Step 2: From the Pivot Table Fields List, Drag the State Field again to Column Labels
Step 3: From the Pivot Table Fields List, Drag the Sex Field to ΣValues
Step 4: To draw a Column chart, select the data and go to Insert->Charts->2D Clusterd Column
Chart
Question 3: Generate the state-wise average Salary by its education level
Step 1: From the Pivot Table Fields List, Drag the Education(Yrs) Field to Row Labels
Step 2: From the Pivot Table Fields List, Drag the State Field to Column Labels
Step 3: From the Pivot Table Fields List, Drag the Yearly Earnings Field to ΣValues
Step 4: Click the Dropdown next to Sum(Yearly…) and Select Value Field Settings in ΣValues
Step 5: Change the sum function to average function in the value field settings dialog box
Step 6: Click Ok
Question 4: What is the average salary by male, female and Race in each state?
Step 1: From the Pivot Table Fields List, Drag the State Field to Row Labels
Step 2: From the Pivot Table Fields List, Drag the Sex Field to Row Labels
Step 3: From the Pivot Table Fields List, Drag the Race Field to Column Labels
Step 4: From the Pivot Table Fields List, Drag the Yearly Earnings Field to ΣValues
Step 5: Click the Dropdown next to Sum(Yearly…) and Select Value Field Settings in ΣValues
Step 6: Change the sum function to average function in the value field settings dialog box
Step 7: Click Ok
Case Study
Question 5: How many numbers of males and females are there in each race?
EX NO: 9 RELATIONAL OPERATORS IN EXCEL
DATE:
Relational operators compare two values to determine if the relational expression is TRUE
or FALSE. Much like arithmetic operators (+, -, *, /, etc.), relational operators appear between
two operands, which can either be numerical constants, Boolean values, text values, cell
references, or nested formulas/functions. A relational expression is a relational operator with
two operands. e.g., 3=3, 5>2, A4 <= SUM (A8:A20), etc.
Note: Be careful to distinguish the values TRUE and FALSE from the labels “True” and “False”.
As with numbers, the computer treats these differently in formulas.
Using Relational Operators in Formulas
To determine the total of three plus five in Excel, the formula =3+5 can be used. The formula
begins with an equal sign and is followed by the appropriate operands and operator. To
determine whether or not it is true or false that 3+5 is equal to 8 use a relational operator:
=3+5=8
An ‘=8’ has been added to the formula. The first equal sign tells Excel that this is a formula,
while the second equal sign is interpreted as a relational operator. Excel will first evaluate in
order of precedence all parentheses, exponents and arithmetic operators before evaluating the
relational operation. That is, the relational operators are last in the order of precedence. In this
case the formula will first add 3 plus 5 to get 8, and then compare to see if =8=8. The resulting
value will be TRUE.
There are six different relational operators that can be used. Examples of each are listed in the
following table:
Table 1: Relational Operators
Description Operator Example Resulting Value
Equal to = = 3+5=8 TRUE
Not equal to <> = Sum(3,7)<>10 FALSE
Greater than > =100>Max(5,10,20) TRUE
Less than < = “B”<“A” FALSE
Greater than or equal to >= =B2=2 where B2 TRUE
contains the value 2
Less than or equal to <= = 99<=8*3 FALSE
Be especially aware of the order of precedence in which these relational expressions are
evaluated. As an example, the formula =B3^2<>10*Sum(A1:A10) would be evaluated as
follows:
First the computer would evaluate SUM(A1:A10).
Next the computer would evaluate B3^2 (^ is the exponent symbol so B2^2 is the
mathematical expression B32)
The result of SUM(A1:A10) would then be multiplied by 10.
Finally the two sides of the relational expression would be compared.
An Example
Consider the spreadsheet in Figure 1. This worksheet lists the cost of trips to Boston and New York
broken down into the costs of Food, Lodging, and Travel. An initial budget amount is listed in cell B1.
A B C D
1 total budget 1200
2
New Boston >
3 Item York Boston NY
4 Food 250 110 FALSE
5 Lodging 300 189 FALSE
6 Travel 660 776 TRUE
7 total 1210 1075 FALSE
8
Within budget
9 FALSE TRUE
Travel the largest cost
10 component TRUE TRUE
Question #1: Write an Excel formula in cell D4, which can be copied down the column, to
determine if this cost component is more for the Boston trip than the New York trip.
Compare the corresponding two values to get a Boolean value. i.e., is it true or false that 110
(food for Boston trip) is greater than 250 (food for NY trip)? This can be implemented using
the greater than relational operator.
Translate into Excel syntax. The cost in Boston, C4, is greater than the cost in NY, B4.
Hence, the formula would be =C4>B4. With relational operators, formulas can frequently
be written in several ways; =B4<C4 is mathematical equivalent to =C4>B4.
Since the formula is being copied down the column, determine which references copy
relatively and which copy absolutely. In this case both references copy relatively.
Question #2: Write an Excel formula in cell B9 that can be copied across the row to determine if
the total cost of this trip is within budget. For convenience the cell B1 has been namedbudget.
Again, two values must be compared to get a Boolean logical result. Therefore a relational
operator should be used. “Within budget” suggests that if the total value of this trip is less
than or equal to the budget a TRUE value should be returned.
In Excel syntax, the formula is =B7<=budget. Note how the named range is being used this
formula.
Since the formula is being copied across the row, consider which references copy relatively
and which copy absolutely. The total value of the trip should change when the column is
changed from NY to Boston (B7 becomes C7). The budgeted value remains the same so cell
B1 should be referred to absolutely. In this case a previously assigned range name has been
used to represent cell B1. Range names always copy absolutely, so no modifications are needed
to this formula.
The final formula is =B7<=budget. If the range name were not used, the formula =B7<=$B1
would be required.
EX NO:10 LOGICAL FUNCTIONS IN MS EXCEL
DATE:
INTRODUCTION:
In this unit, you will learn how to:
Define range names and use names in formulas
Identify and apply Excel’s logical functions, IF, AND, OR
Create nested functions by combining logical functions in a formula
In Excel, you can create meaningful names for cells or ranges that can be used to overcome
these difficulties.
What Are Range Names?
Range names are meaningful character strings that you can assign to individual cells or cell
ranges. You can use a range name practically anywhere you can use a cell or range reference.
The advantage of using names comes from the fact that a name, like Employees, is more
meaningful and less abstract than a reference like C2:C55. Also, named ranges are by default
absolute, so if you copy or AutoFill a formula using named ranges, it will maintain its original
cell references.
Defining and Using Range Names
To define a range name:
Select either a cell or cell range
On the Formulas Ribbon, choose the Define Name button from the Defined Names
group
To name your range, type a name in the top text field and click OK. The Scope refers to
the parts of the workbook where your named range will be valid.
Press Enter.
Note: Excel will not accept spaces between words in the names you choose. For example,
“newrange” or “newRange” or “new_Range”would be acceptable, but “New Range” would
not.
Once you have defined your named ranges, you can use them in formulas and functions just as
you would a regular cell or range reference.
Using Logical Functions
Excel 2007’s logical functions are:
AND FALSE
OR TRUE
IF IFERROR
NO
These logical functions are important when doing advanced work in Excel because they can
help you control the behavior of your worksheets based on specific logical conditions.
This unit will focus on the use of the logical functions IF, AND, OR
Using the Function Library
Excel 2007 contains an extensive library of functions that you can call upon to help you solve
problems. These tools are available in the Function Library button group, on the Formulas
ribbon.
The first and largest button is Insert Function. This button will open a dialog allowing you to
search for and insert hundreds of functions.
You can also click the small fx button next to the formula bar to display the Insert Function box.
When you do this in Excel 2007, a screen tip will appear with the possible functions that
correspond with the letters of the function name you have entered.
For example, if you type =IF into a cell the following appears.
Once you have selected the function you wish to use, continue by typing in a left bracket, which
will cause the function syntax to display in another screen tip.
Continue to enter all the arguments required for the function to give you a result, ensuring you
type a comma between each argument.
You can have as many as 255 logical arguments to an Excel AND function.
The following table (often referred to as a truth table) may help you understand the AND
function. In the last column of the truth table, you will see the value returned by the function,
according to the corresponding values of the function arguments.
A B AND(a, b)
The OR Function
The OR function returns TRUE if any of the conditions are TRUE and returns FALSE if all
conditions are false. For instance, the logical statement 1<10 OR 2<1 is true, since 1 is less than
10. It does not matter that the statement 2<1 is false, because you have a choice of either 1<10
OR 2<1 to make the compound statement true. If one or both of the arguments is true, the
overall OR statement will also be true.
A B OR(A,B)
=IF(A1=10,100,IF(A1=5,200,0))
Value if FALSE
In the case of this IF function, if the value in cell A1 is 10 the function will return 100. If the
value in A1 is not 10, the function will test if the value in A1 is 5. If the value in A1 is 5, the
function will return 200. If it is not 5 (and also not 100) the function will return 0.
When you nest logical functions, you must make sure that the number of closing parenthesis
matches the number of opening parenthesis used in the function. If you count the parenthesis in
the function from the image above, you will see two opening, and two closing parenthesis.
Applying Logical Functions
Nested functions can also be created using the IF and OR functions together; or the IF and AND
functions together.
For example:
PROCEDURE:
IF FUNCTION
1. Select cell C1 and enter the following function.
The IF function returns Correct because the value in cell A1 is higher than 10.
AND FUNCTION
2. Select cell D1 and enter the following formula.
The AND function returns FALSE because the value in cell B1 is not higher than 5. As a result
the IF function returns Incorrect.
OR FUNCTION
3. Select cell E1 and enter the following formula.
The OR function returns TRUE because the value in cell A1 is higher than 10. As a result the IF
function returns Correct.
General note: the AND and OR function can check up to 255 conditions.