0% found this document useful (0 votes)
6 views58 pages

CHAPTER 5 - Data Analysis Using MS Excel 2007

The document provides a comprehensive overview of Microsoft Excel, detailing its features such as the redesigned user interface, the Ribbon, and various tabs including Home, Insert, Page Layout, Formulas, Data, Review, and View. It explains functionalities like data analysis, formatting tools, printing options, and formula creation, emphasizing the importance of understanding Excel's order of operations for calculations. Additionally, it covers features for managing documents, including saving, printing, and preparing documents for sharing.

Uploaded by

PBM Khushab
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views58 pages

CHAPTER 5 - Data Analysis Using MS Excel 2007

The document provides a comprehensive overview of Microsoft Excel, detailing its features such as the redesigned user interface, the Ribbon, and various tabs including Home, Insert, Page Layout, Formulas, Data, Review, and View. It explains functionalities like data analysis, formatting tools, printing options, and formula creation, emphasizing the importance of understanding Excel's order of operations for calculations. Additionally, it covers features for managing documents, including saving, printing, and preparing documents for sharing.

Uploaded by

PBM Khushab
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 58

Computer literacy Program… Data Analysis using MS Excel

Chapter-5

DATA ANALYSIS USING


MS-EXCEL

182
Computer literacy Program… Data Analysis using MS Excel

Introduction to excel
Microsoft Excel is a spreadsheet application developed by Microsoft. It features calculation, graphing
tools, pivot tables, data analyzing etc. Microsoft Excel 2007 has a completely redesigned user interface.
The standard menus along the top have been removed and replaced with a series of toolbars Microsoft
calls ―The Ribbon.‖ These tool bars are changed using tabs at the top and try to automatically adjust
themselves to the content you are working with.

The Office Logo


The first thing most people will need to relearn is where to go to open a
document, create a new one, save your document and print. Clicking the Office
logo at the top left of the screen will provide most of the items formerly found
under the file menu including those listed above. Beside the logo you also will
find a disk icon to save your document as well as the undo and redo buttons.
More buttons can be added to this ―Quick Access Toolbar‖ through the Excel
options mentioned in the next section.

the Office logo opens up listing your


options for new, open etc. and also contains
a list of your recent documents for quick
opening. Any of the items listed with an
arrow beside them will replace the recent
documents on the right with the options
associated with the menu item. You should
also see at the bottom right of this menu a
button for exiting Excel and changing
Excel’s options.

Save as
The save as option will provide you with the
most common file formats to save your
document in. The common ones are Excel
Workbook, Excel Macro-enabled
Workbook, Excel Binary Workbook, and
Excel 97-2003 Workbook. The last one is
the option most people should be using currently, especially if they wish to share documents with others
who do not have the new version of Office.

183
Computer literacy Program… Data Analysis using MS Excel

Print
Here you can choose from Print, Quick Print and Print Preview. Print brings up the standard print dialog
box, quick print will print one copy without any dialog box coming up and print preview will bring up the
print preview screen.

Prepare
The prepare menu’s most common options are Properties, Inspect Document, Mark as Final and Run
Compatibility Checker. The properties option allows you to setup metadata for the document like Author,
Title, keywords, comments and others. Inspect Document will scan the document for any hidden data like
comments and annotations, and any hidden collaboration data. This is very useful when making a
previously private document public. It will help you find any comments or changes made previously that
should not be made public. Mark as Final will mark the document as a final copy and make it read only
so changes cannot be made. The last common item, Run Compatibility Checker will scan the document
for new features that were used and show you these. This is recommended if you where creating a
document in the new file format but now need to convert it back to the Office 2003 format to share with
someone who does not have Office 2007.

The Home Tab

The home tab the basic formatting tools found in Excel 2007. You will find seven sections, Clipboard,
Font, Alignment, Number, Styles, Cells and Editing. Clicking the down arrow beside any of the icons
here will drop down more options for that tool. Each section also contains an arrow in the bottom right
corner which will open a window containing the options found in that section.

Clipboard
The Clipboard allows you to cut, copy, paste and copy formatting from one place to
another.

Font
The font section of the ribbon provides a section to handle
the basic text formatting. Items such as bold, underline,

184
Computer literacy Program… Data Analysis using MS Excel

strikethrough, highlight and font type can be changed here. Some items from this section and some items
from the number section are also available by right clicking a cell. This saves having to move your cursor
all the way to the top of the screen for some common formatting items.

Alignment
The alignment section provides icons to justify, Vertical alignment, indents,
text wrap, merge cells and centre text and text orientation.

Number
The number section provides the options for formatting numbers. You can choose the
type of number, like date, currency, percentage, fraction or general. You can also increase
or decrease the number of decimal places shown.

Styles
The styles section allows you to quickly change the formatting of a section of
cells by choosing one of the predefined styles. You can choose different types of
conditional formatting, table formatting or cell styles. These are used to change the visual appearance of a
section to quickly show what is being displayed in an area.

Cells
This section allows you to insert of delete cells, rows, columns, or sheets. You can also
format the height or width of columns and rows, hide or unhide elements, organize or
protect cells and sheets. There are a lot of features in this section under the format option.

Editing
The editing section gives you options for inserting functions, filling formulas across

185
Computer literacy Program… Data Analysis using MS Excel

cells, clearing formatting and formulas, sorting and finding. Again, there is a large number of options in
this area. These options are also included in the image to left.

Insert Tab

The insert tab has five sections for inserting most types of objects. The sections are tables, illustrations,
charts, links, text and symbols.

Tables
The tables section has an option for pivot tables and charts and tables. You can select
an area and turn it into a formatted table or pivot table with these options. Once you
have created your table there is another tab which becomes available to work with the table design. This
tab is shown below.

Table Design

Illustrations
The Illustrations section allows you to insert pictures, clipart, shapes, and SmartArt. After inserting or
selecting a picture you are provided with a new toolbar along the top shown here.

186
Computer literacy Program… Data Analysis using MS Excel

This toolbar gives you the ability to change the brightness, contrast, shape, position, text wrapping and
other options for the picture. Clicking off the picture or on one of the other tabs will take you back to the
standard toolbars. The Shapes option of the Illustrations section allows you to insert lines, arrows, boxes,
basic flowchart shapes and a number of others. The SmartArt option provides features like org charts,
flow charts, illustrated lists and processes. The Chart option is similar to Excel 2003 but it offers more
options for your charts.

Charts
The charts section provides drop down menus to insert different
types of column, line, pie, bar, area, scatter and other types of charts. Once you create a chart you will get
three additional tabs to work with your chart. They are shown below.

Chart Design Tab

Chart Layout Tab

Chart Format Tab

Links

187
Computer literacy Program… Data Analysis using MS Excel

The links section provides options for inserting hyperlinks to your spreadsheet.

Text
Options in the text section include text box, header and footer,
WordArt and a number of predefined text blocks like a signature line
and symbols. There are a lot of option in here to setup on your own or you can use Excel’s predefined
options.

Page Layout Tab

The page layout tab has five sections, Themes, Page Setup, Scale to Fit, Sheet Options, and Arrange.

Themes
The themes section provides a quick way to format your document. By choosing a
theme you will have a set colour scheme, font combinations, and effects. You can
choose one of the provided themes, modify any provided theme or create your own. You can also go
online in this section and browse Microsoft.com for additional themes. Be aware that changing your
theme after creating a document may require you to reformat some items as themes also include some
layout options.

Page Setup
Page setup provides you with the tools to change
margins, size, orientation, columns, breaks,
backgrounds and add print titles to the document.

Scale To Fit
This section allows you to scale to fit your document onto a certain number of
pages or to scale it to a certain percentage of it’s current size.

188
Computer literacy Program… Data Analysis using MS Excel

Sheet Options
This section gives you checkboxes to view or print headings and gridlines.

Arrange
The arrange section is also found in the image toolbar when an image is selected.
Here you can change an images position, the alignment, grouping and rotation or
the image.

Formulas Tab

The formulas tab contains four sections, function library, defined names, formula auditing and calculation.

Function Library
This section gives you access to the large number of predefined
Excel functions. There are Auto Sum functions, financial, logical, text, date and time, lookup and
reference, math and trig, and additional functions. It also provides a section for recently used functions so
you can get back to the ones that you use the most quickly.

Defined Names
The defined names section allows you to create names or variables to be
referenced in other areas. This would be like assigning ―taxrate‖ to cell b2
so in a formula you can easily see what you were referencing when you look at a formula months after
creating it. The formula =A10*taxrate means more later than =a10*b2

Formula Auditing
This section provides tools to manage formulas to ensure that they are
correct. You can use the tools here to find out what cells your formula

189
Computer literacy Program… Data Analysis using MS Excel

depends on, what cells depend on the current cell, and show the formula in a cell instead of the resulting
value. There is also a tool for error checking which will look for common errors in formulas.

Calculation
Here you can turn on or off automatic calculation from formulas. If you turn off
automatic calculations you can use this area to calculate the current cell or the whole
sheet.

Data Tab

The data tab contains five sections, get external data, connections, sort and filter, data tools, and outline.

Get External Data


This is a single drop down item which allows you to refresh data from an external source.
You can pull in data from Access, the Internet, text files or from other external sources.

Connections
Here is where you manage any connections to outside sources. The setup done
here is what allows you to pull data from the external sources listed above.

Sort & Filter


Here you can sort or filter your data based on criteria you specify. You
can use simple alphabetical sorting or create more complex filters to
manipulate your data.

190
Computer literacy Program… Data Analysis using MS Excel

Data Tools
With the data tools section you can take text and turn it into columns,
remove duplicates, check your data to make sure it is valid based on
different criteria. Are they all whole numbers? Are they all properly formatted dates? You can also
consolidate data or do ―What if‖ analysis where you can check you data against different scenarios.

Outline
The final section in the data tab provides tools to group or ungroup rows or columns
and obtain subtotals for grouped items.

Review Tab

The review tab offers three sections which include proofing, comments, and changes.

Proofing
The proofing section provides the standard spelling and grammar check, a
thesaurus, and research tools that include MSN search and Microsoft Encarta encyclopedia. You will also
find translation tools to help with single words or the whole document. The translation of the entire
document is done by an online service called Wordlingo.

Comments
The comments section allows you to add comments to a
document for easier collaboration. You can cycle through the comments to find out what notes you left
for yourself or others and you can delete a comment that was made when it is no longer relevant.

191
Computer literacy Program… Data Analysis using MS Excel

Changes
The changes section allows you to protect a sheet or the
entire workbook, you can also share a workbook. Some of the sharing features are only available to users
on a Windows domain. This authenticates the users against the domain for access so this will not work
for many people.

View Tab

The view tab offers five sections which include workbook views, show/hide, zoom, window and macros.

Workbook Views
The workbook views section switches your display between normal
view, page layout, full screen and page break preview. The page layout
will show you what will be on each page and provide a way to add headers and footers to each page. The
page break preview will show you a scaled version of your spreadsheet with dotted lines showing where
the page breaks will be. There is also a way to work with custom views here.

Show/Hide
The show/hide section will toggle certain tools on or off the screen including
rulers, gridlines, message bar, formula bar and headings. The rulers will
show along the top and left side of the screen. Gridlines will show the grids around each cell. They will
be visible on screen but don’t print.

Zoom
The zoom section provides tools to zoom into or out of the document. You can
choose your own zoom factor or use the predefined zoom factor of 100% or you can select a section and
zoom so it fills your screen.

192
Computer literacy Program… Data Analysis using MS Excel

Window
The window section allows you to create a new window, arrange
your windows one on top of the other or split your window so the
same document is viewed in two screens one on top of the other. You can also hid and unhide a window.
Once you have arranged your windows the way you like them you can save the workspace so you can
open to this setup when you need to work on these items again. This is very handy for setups where you
need to work on multiple documents at once and you have to do this a lot. You can also choose which
window to work on through the switch windows drop down menu.

Macros
The macros section provides the tools required to work with and create basic macros. You can
view existing macros or record your own. Choose record macro from the drop down and then perform the
functions you do often, like change the page layout, and style of the document. Once you have done those
tasks then stop recording. You will be able to use that macro over again to shorten the steps you need to
take every time you need to perform that set of tasks.

Page setup
In the Excel 2007 Page Setup section of the page layout
tab the first button is Margins. Click the down arrow to
see the default selections. These are the margins that you
need to set for printing your document. set custom
margins by clicking the custom margins selection at the
bottom of the Margins button.

The Page Setup window will open automatically to the


Margins tab. In this tab you can set the top, bottom, left
and right margins. In this tab you can also set the spacing
for the header and footer or center the spreadsheet either
horizontally or vertically on the page. The page in the
center will give you a preview of how your spreadsheet
will print.

The next button is Orientation. Click the down arrow on


the Orientation button. This button lets you change the
orientation of your spreadsheet to portrait or landscape. If
you are following the Budget tutorial Change the
spreadsheet to Landscape then click print preview to
make sure the whole spreadsheet fits on the page. If it does not fit we will get to
that soon.

193
Computer literacy Program… Data Analysis using MS Excel

The next button in the Page Layout tab, page setup section is Size. This button will let you select
the size of the paper you will print your spreadsheet on. Printing small spreadsheets on note cards
for school exams is where I found this option most valuable.

Click the down arrow to see all of the page size options.

The 8.5” x 11” paper size is the default selection. use the scroll bar on the right had side of the
drop down menu to see more sizes or if you would like more options click the More Paper sizes
option at the bottom of the list.

Formulas and functions


One of Excel's most useful features is that it allows users to create custom formulas to perform
calculations on their data. Excel also contains built-in formulas called functions that make it easy
to perform common calculations on data.

Formula Basics

Formulas in Microsoft Excel begin with an equal sign. The equal sign tells Excel that the
succeeding characters constitute a formula. If you don't enter the equal sign, Excel will treat your
entry as text and the calculation will fail.

Order of Operation

When performing calculations in a formula, Excel follows


certain rules of precedence:

 Excel calculates expressions within parentheses first.


 Excel calculates multiplication and division before
addition and subtraction.
 Excel calculates consecutive operators with the same
level of precedence from left to right.

For example, the formula = 10+10*2 gives a result of 30 as


Excel multiplies 10 by 2 and then adds 10. However, the
formula =(10+10)*2 produces a result of 40. This is because
Excel calculates the expression (10+10) within the
parentheses first. It then multiplies by 2.If you are unsure of
the order in which Excel calculates, use parentheses - even if
the parentheses aren't necessary. Parentheses also make your
formulas easier to read.

Conditional Formatting

Conditional Formats respond to the contents of cells. They are almost always applied to group of
cells, often rows or columns of totals, if not entire tables.
194
Computer literacy Program… Data Analysis using MS Excel

Click Home Tab, locate the Style group and click on the downward arrow of Conditional
Formatting.

When you click on Highlight Cell Rules this method will keep the cells ―inactive‖ until the
values (numeric or text) contain the specific
rule you select the option : Greater Than,
Less Than Between, Equal To, Text that
Contains, A Date Occurring, and Duplicate
Values. Once you have selected a rule a
dialog box will appear where you may
specify the appropriate criteria.

In addition to Highlighting Cell Rules there are four other options:

1. Top Bottom: Selected formatting applied to all cells in a range that are greater than or less
than a given threshold. Click Top 10 Items, Top 10%,
Bottom 10 Items, Bottom 10%, Above Average, or
Below Average to display a dialog box where you can
specify the appropriate criteria.

2. Data Bars: Gradient fills of color within cells whose


lengths indicate the values in the cells relative to all other
adjacent cells formatted using the same conditions.
Choose from a number of different colors, based on the
current theme. Excel will automatically allow you to
preview the proposed changes before actually clicking on
the changes.

3. Color Scales: Two-color or three-color formats whose color indicates the values in the cells
relative to all other adjacent cells formatted using the same conditions. Choose from a number of
different color combinations, based on the current theme.

4. Icon Sets: Sets of three, four, or five tiny graphic images placed inside cells whose shape or
color indicates the values in the cells relative to all other adjacent cells formatted using the same
conditions. Choose from a number of different types of icons

195
Computer literacy Program… Data Analysis using MS Excel

Formulas & Functions

The organization of the formulas is new to Excel. formula dialog box appear on the Formula Tab.
Each formula is divided up among relevant general topic categories. The categories are listed
across the top of the Formula Tab group titled Function Library.

Excel formulas are used to make the data you have entered more useful. Through the use of
formulas you are able to, at a minimum, maintain finances, schedules, and detailed reports

Basic Formulas

Add the Values in Rows or Columns

Use the SUM function, which is prewritten formula, to add all the values in a row or column:

1. Click your mouse in the cell in which you wish your result to appear

2. Click the AutoSum button on the Home Tab or the Formulas Tab

3. Highlight the range of cells you wish to add

4. Press Enter

To add some of the values in a column or row:

1. Type an equal sign, type SUM, then type an opening parenthesis.

2. Type or select the cell references you want to add. A comma (,) separates individual
arguments that tell the function what to calculate

3. Type a closing parenthesis, and then press ENTER.

For example: =SUM(B2:B4, B6) and =SUM(B2, B5, B7)

Use the AVERAGE, MAX, OR MIN functions.

1. Click your mouse in the cell in which you wish your result to appear

2. Click the arrow next to AutoSum on the Home Tab or the Formulas Tab.
196
Computer literacy Program… Data Analysis using MS Excel

3. Click the Average, Max, or Min

4. Highlight the range of cells you wish to find the value for

5. Press Enter

To see more functions, click More Functions on the AutoSum list to open the Insert Function
dialog box OR go to the Formulas Tab and click on the More Functions orange textbook icon.

Using Date & Time Formulas

In this example we have a list of birthdays. Our objective with this data is to find out how many
birthdays occurred more than six months ago, and how many occurred five years ago. To start
we want to know todays date.

Step 1: Click in cell A2

Type in =TODAY( ) and press ENTER.

The computer will automatically enter in today’s date.

Step 2: Click in cell C2. In this example, we want this value to be


five years before today’s date. To do this, the formula must be
=EDATE(A2-60) and press enter.o 60 months in five years If you
simply get a numerical value instead of a date, that means you have
to format the cell to be a date. Right click on the cell and click
Format Cells. In the Number tab of the format dialog box, choose
Date. Choose whatever date format you wish and then click Ok

PRODUCT Function

The PRODUCT function provides a quick way to multiple numbers in a Excel. The advantage of
using this function becomes apparent if you have several numbers to multiply together. It is
easier then building a long formula.

The syntax for the PRODUCT function is:

=PRODUCT( Number1, Number2, ... Number255 )

TIP: Up to 255 numbers can be entered into the function.

SUMIF Function

197
Computer literacy Program… Data Analysis using MS Excel

The SUMIF function is used to add up the values in cells in a selected range that meet certain
criteria.

The syntax for the SUMIF function is:

= SUMIF (Range, Criteria, Sum Range)

Range - the group of cells the function is to search.

Criteria - determines whether the cell is to be counted or not.

Sum Range - the data range that is summed if the first range meets the specified criteria. If this

range is omitted, the first range is summed instead.

ROUND Function

The ROUND function is used to reduce a given value to a specific number of decimal places.

The syntax for the ROUND function is:

= ROUND ( Number, Num_digits )

Number - the value to be rounded.

Num_digits - the number of decimal places to reduce the above number to.

IF Function

The IF function, one of Excel’s logical functions, tests to see if a certain condition in a
spreadsheet is true or false.

The syntax for the IF function is:

=IF ( logical_test, value_if_true, value_if_false )

logical_test – a value or expression that is tested to see if it is true or false.

value_if_true – the value that is displayed if logical_test is true.

Excel 3: Formulas and Functions Page 12 of 16 Last Updated 02/15/2011

value_if_false – the value that is displayed if logical_test is false.

Lookup & Reference Icon

198
Computer literacy Program… Data Analysis using MS Excel

VLOOKUP Function

Excel's VLOOKUP function, which stands for vertical lookup, is used to find specific
information that has been stored in a spreadsheet table.

Note: The data in the table should be sorted in ascending order (alphabetically A to Z).

The syntax for the VLOOKUP function is:

= VLOOKUP ( lookup_value , table_array , col_index_num ,range_lookup )

lookup _value: The value you want to find in the first column of the table_array.

table_array: This is the table of data that VLOOKUP searches to find the information you are

after.

The table_array must contain at least two columns of data. The first column contains the
lookup_values.

col_index_num: The number of the column in the table_array that contains the data you want

returned.

range_lookup: A logical value (TRUE or FALSE only) that indicates whether you want
VLOOKUP to find an exact or an approximate match to the lookup_value. Typing False will
return exact matches only.

TRANSPOSE Function

The TRANSPOSE function, one of Excel's Lookup & Reference functions, is used to copy data
located in a

row into a column or copy data located in a column into a row.

The syntax for the TRANSPOSE function is:

{ = TRANSPOSE ( Array )}

Array - the range of cells to be copied from the horizontal to the vertical or vertical to the

horizontal.

The curly braces " { } " surrounding the function indicate that it is an array function.

AVERAGE Function

199
Computer literacy Program… Data Analysis using MS Excel

The AVERAGE function, one of Excel's statistical functions, is used to find the average or
arithmetic mean of a given list of arguments. The syntax for the AVERAGE function is:

= AVERAGE ( argument1, argument2, ... argument255 ) Argument1, argument 2, ...


argument 255 can be numbers, named

ranges, arrays, or cell references.

Tip: Up to 255 arguments can be entered.

MAX Function

The MAX function, one of Excel's statistical functions, is used to find the largest or maximum
number in a given list of values or arguments. The syntax for the MAX function is:

=MAX( argument1, argument2, ... argument30 )

Argument1 ... argument 30: The arguments can be numbers, named ranges, arrays, or cell
references.

Up to 30 arguments can be entered.

MIN Function

The MIN function, one of Excel's statistical functions, is used to find the smallest or minimum
value in a list of numbers or arguments. The syntax for the MIN function is:

=MIN ( argument1, argument2, ... argument30 )

Argument1 ... argument 30: Arguments can be numbers, named ranges, arrays, or cell references.
Up to

30 arguments can be entered.

COUNT Function

Excel's COUNT function is one of a group of Count Functions that can be used when you need to
total the number of cells in a selected range. The COUNT function's job is to only add up the
cells in a selected range that contain numbers. It ignores empty cells or those contain text. If a
number is later added to an empty cell the function will be automatically updated to include this
new data. Be aware that dates, times, functions, and formulas are stored as numbers in Excel. The
COUNT function will, therefore, include any cells containing these types of data in the total.

The syntax for the COUNT function is:

=COUNT( Range )

200
Computer literacy Program… Data Analysis using MS Excel

Range - the group of cells the function is to count.

Insert and delete header, footer, and header in Excel


The Microsoft Excel's Header/Footer command can help to show information in the header or
footer at the top or bottom of each printed page easily. And allow to add some images in the
header, such as company’s logo, etc.

Insert & delete header and footer in Excel

Step 1: Click the Header & Footer button in the Text group under Insert tab in Microsoft Excel

Step 2: Then it display the header editable area at the top of worksheet.

Enter the information want to show at the top of every printed page based on needs.

Step 3: When cursor stays in the header editable area, the Header & Footer Tools is active:

User can click the Header button and Footer button in the Header & Footer group to insert all
kinds of header and footer.
201
Computer literacy Program… Data Analysis using MS Excel

Delete Header and Footer

If user want to delete the Header from worksheet, user can click the Design >> Header >> none
under Header & Footer Tools. So does deleting the Footer.

More Options in the Header & Footer Elements group

 Page Number button and Numbers of Pages button: Insert the page numbers in the
footer or header.
 Current Date button and Current time button: Insert current time/date in the footer or
header.
 File name button: Insert current workbook's name in the footer or header.
 File Path button: Add the name of the current workbook, including the full saving path,
to the header or footer.
 Sheet Name button: Add the name of current sheet to the header or footer.

Creating Charts in Excel


Charts make data visual. With a chart user transform spreadsheet data to show comparisons,
patterns, and trends. The new charting capabilities in Excel make it much easier to turn data
into meaningful information

Charts start with data. In Excel 2007, select data in worksheet, choose a chart type
use the new Chart Tools to customize the design, layout, and formatting of chart .look just by
pointing at them in the dialog box, even before you make a choice.

Clicks to create a simple chart in Excel

1. Select the cells containing the sales data, including cells with text (e.g. column and
row headings for the data.) In this example, the cells are A1:D4. (Yes; we also
include the blank cell, A1.)
202
Computer literacy Program… Data Analysis using MS Excel

2. Select Insert tab.


3. Select Column icon from Charts group.
4. Select Clustered Column chart from 2-D Column type.

Chart Elements

A chart has many elements. Some of these elements are displayed by default, others can be added
as needed.
You can change the display of the chart elements by moving them to other locations in the chart,
resizing them, or by changing the format. You can also remove chart elements that you do not
want to display

Here are some standard chart elements.


1. The chart area encompasses the entire chart and all its elements.
2. The plot area is that area bounded by the axes, including all data series, category names, axis
titles, and all markers that represent data points.

203
Computer literacy Program… Data Analysis using MS Excel

3. The data points are the individual values plotted in a chart and represented by bars, columns,
lines, pie or doughnut slices, dots, and various other shapes called data markers. Data markers of
the same color constitute a data series (i.e. related data points. You can plot one or more data
series in a chart, but pie charts have only one data series.
4. The horizontal (category) or vertical (value) axis is a line bordering the chart plot area used as
a frame of reference for measurement. The y-axis is usually the vertical axis and contains data.
The xaxis is usually the horizontal axis and contains categories.
5. A legend is a box that identifies the patterns or colors that are assigned to the data series or
categories in a chart.
6. A chart title is the descriptive text for a chart. Note that horizontal and vertical axes
usuallyhave titles too.

Creating charts in Excel

To create a chart in Excel, you start by entering/selecting the data for the chart. The data can be
arranged in rows or columns — Excel automatically determines the best way to plot the data in
the chart.
Some chart types (e.g. pie charts) require a specific data arrangement as described in the
following table.

Modifying charts

After you create a chart, you can modify it. For example, you may want to change the way that
axes are displayed, add a chart title, move or hide the legend, or display additional chart
elements.
To modify an element in the chart, you can right-click on it and choose the appropriate (format)
option.
Or, you can use the appropriate tabs, groups and options under Chart Tools.
Add titles to a chart: Chart Tools -> Layout -> Labels -> Chart Title

204
Computer literacy Program… Data Analysis using MS Excel

Add axis titles to a chart: Chart Tools -> Layout -> Labels -> Axis Title
Add legend to a chart: Chart Tools -> Layout -> Labels -> Legend

Add data labels to a chart: Chart Tools -> Layout -> Labels -> Data Labels

Add data table to a chart: Chart Tools -> Layout -> Labels -> Data Table

To change formatting and layout of each axes: Chart Tools -> Layout -> Axes ->Axes

To turn gridlines on or off: Chart Tools -> Layout -> Axes -> Gridlines

To format the plot area: Chart Tools -> Background -> Plot Area

To format the chart wall (for 3-D charts): Chart Tools -> Background -> Chart Wall

To format the chart floor (for 3-D charts): Chart Tools -> Background -> Chart Floor

To change 3D viewpoint of a chart: Chart Tools -> Background -> 3-D Rotation

To move chart to a different sheet: Chart Tools -> Design -> Location -> Move Chart

How Charts change when data is changed


Charts are not necessarily static. A chart can change if the data used to draw it is changed.
Again using the above example, let’s say you want to draw a pie chart to show the percentage of
coffee, juice and milk sales in any month.

The chart looks different


depending on which month it is.Let’s set up some formulas to get the data for the chart.

1. In cell B9, use Data Validation to select either January, February, or March.
Data -> Data Tools -> Data Validation -> Allow: List; Source: January, February,
March
205
Computer literacy Program… Data Analysis using MS Excel

2. In cell B10, B11, and B12, write the formulas as shown above.

Now we can draw a 3D-Part chart:


1. Select the cell range A9:B12.
2. Select Insert tab.
3. Select Pie icon from Charts group.
4. Select Pie in 3-D type.
5. Change the value in B9 by selecting January, then February, then March.

How is the pie chart changing?

We can also draw a Doughnut chart:


1. Select the cell range A1:C4.
2. Select Insert tab.
3. Select Doughnut icon from Charts group.
4. Change any value in Cells B2:C4. How is the Doughnut chart changing?

How to Write a Simple Macro in Microsoft Excel


Increase the usability of your Excel spreadsheets by adding a little programming to
them. While Excel's formulas and spreadsheet features make it a great tool,
mastering the ability to create macros will make it even greater and faster to work
with. Learn how with these steps.

206
Computer literacy Program… Data Analysis using MS Excel

Step 1: Click the Developer tab on the Ribbon at the top of the screen. If the
tab is not showing up on your screen, you can add it as follows:

 For Excel 2010: click the File Tab then select options. On the left hand
side of the Excel options dialog box, click Customize Ribbon. Then, on the right
hand side box select Developer.

 For Excel 2007: click the Microsoft Office button, then Excel Options.
In the Popular category, under Top Options for Working with Excel, select Show
Developer Tab in Ribbon.

207
Computer literacy Program… Data Analysis using MS Excel

Step 2: Change the security settings. In Trust Centre, Under Macro Settings,
clickEnable All Macros, then click OK.

208
Computer literacy Program… Data Analysis using MS Excel

 Note that this security setting is not ideal for basic use. When you've
finished creating your macro, go back and un-click Enable All

Macros.

Step 3: Click Record Macro. You'll find it on the Developer tab under Code.

209
Computer literacy Program… Data Analysis using MS Excel

Step 4: Name your macro. The first character of the name must be a letter; after
that, you can use characters, numbers and underscores. Macro names cannot have
spaces.

 Don't use the same name for your macro as an existing cell reference.

210
Computer literacy Program… Data Analysis using MS Excel

Step 5:
Set a shortcut for your macro (optional). Type a letter in the Shortcut Key box.
A lowercase letter will translate to CTRL + letter; an uppercase letter will be CTRL
+ SHIFT + letter.

211
Computer literacy Program… Data Analysis using MS Excel

Step 6: Choose where to store your macro. In the Store Macro In list, select the
workbook where you want to store the macro. If you want it to be available
whenever you run Excel, select Personal Macro Workbook.

Step 7:
Describe your macro. Write this in the Description box.

212
Computer literacy Program… Data Analysis using MS Excel

Step 8:
Click OK to start recording your macro.

213
Computer literacy Program… Data Analysis using MS Excel

Step 9: Perform the actions you want the macro to record.

214
Computer literacy Program… Data Analysis using MS Excel

Step 10: Stop recording. Go to the Developer tab, click Code, then click Stop
Recording.

215
Computer literacy Program… Data Analysis using MS Excel

Excel’s Business Tools: What-If Analysis


Introduction

What-If Analysis is an important aspect of planning and managing any business. Understanding the
implications of changes in the factors that influence your business is crucial when it comes to making
important business decisions. What would be the effect of an increase in your costs, or if turnover rose or fell
by a certain amount? How would a change in interest rates or exchange rates affect your profits? Excel
offers some easy-to-use tools to save time doing your calculations and
help you make more accurate forecasts.

This tutorial uses the simple example of a cash loan to demonstrate some of these tools. It makes use of
Excel's PMT Function to calculate repayments on a loan, then shows how you can use the Goal Seek tool to
manipulate variables such as the amount borrowed, repayment period and
interest rate to arrive at a desired result. You will see how to use Data Tables to display a large number of
calculations employing one or two variables and finally use Conditional Formatting to present the results in
an easily understandable way.

The screenshots in this document were taken in Excel 2010 and apply equally to Excel 2007. Most features
also apply to Excel 2003.

The PMT Function

The PMT function is used to calculate the repayments on a loan based on a constant interest rate.
It can accept up to five arguments. The first three are required and often only these are used:

Rate - The interest rate expressed as a percentage (you use the percent sign when entering the rate into the
cell). When entering this argument you need to take account of the frequency of the payments. For example,
if the payments are monthly this value should be divided by 12 when
entered into the function.

Nper - The total number of payments for the loan. For example, for a loan repaid monthly over a period of 3
years this value would be 36 (i.e. 36 months).

Pv - The present value. This represents what the total value of the loan is worth now (i.e. how

much is to be borrowed). Enter this as a minus value so that the function returns a positive value for the
repayments.

There are two additional optional arguments:

Fv - The future value. Enter a value here if you want to end the loan period with a cash balance

(i.e. it is not being paid off completely to zero). Omit this value if the entire amount borrowed is to be repaid.

Type - Usually repayments are made at the end of each period, in which case this argument is omitted. Enter
1 if the repayment is made at the beginning of the period.

216
Computer literacy Program… Data Analysis using MS Excel

The Goal Seek Tool

The Goal Seek tool allows you to determine what value a particular argument needs to hold so that that a
function will return a specified value. In this example the PMT function has calculated that a loan of £20,000
over 60 months at an interest rate of 6.8% per annum will require a monthly
repayment of £394.14. Using the Goal Seek tool you can find out, for example, how much money you could
borrow if the repayments were only £350 per month. Essentially, you tell Excel what you want the answer to
be and which value it can change to achieve that.

1. Open the Goal Seek tool by going to the Data tab then choosing What-If Analysis and
Goal Seek.

2. In the Goal Seek dialog box specify which cell will display the desired value. To do this click
in the Set cell: textbox then click on the cell that displays the result of your calculation.
This cell must contain a calculation (a formula or function).

3. Type the value that you want the calculation to return in the To value: textbox.

4. Specify which cell contains a value that Excel can change in order to arrive at the desired
result. Do this by clicking in the By changing cell: textbox then clicking on the cell that
contains the value that you are allowing Excel to change. This cell must be one of the
values used, directly or indirectly, in the calculation.

5. Click the OK button to perform the Goal Seek.

When you click OK Excel calculates the required value and opens a new dialog box to display the
result. It also inserts a new value into the specified cell so that the calculation now displays the
required result (Fig.2).
217
Computer literacy Program… Data Analysis using MS Excel

Fig.2 Using the Goal Seek tool to arrive at a specified value.

The Goal Seek tool is very useful and saves a lot of ―trial and error‖ when trying to forecast the

result of changes to your calculations, but it is limited to changing only one variable at a time. To see the
result of a changing input over a range of values would require you to run Goal Seek many times and record
the input values and results for each. (Excel’s Solver Add-In can be used for
working with more than one variable but is a very much more complex tool to use.) Fortunately, Excel has
another tool to help simplify that job, the Data Table.

Data Tables
Excel's Data Table tool provides a quick and easy way to perform "what if" analysis. It is used to create a
range of cells called the data table. The values displayed in the data table represent the result of changing
certain input variables in your calculation. You can specify what those changing variables are and the range
of input values that is used to create the table. Calculations can contain many input variables. The data table
tool can be used to represent changes in one or two of them. As with the Goal Seek example, this example
also uses the PMT function to demonstrate data tables. Although this is a simple example remember that
data tables can be used with any calculation that has a variable input.

You might want to vary any of the values used by the PMT function. The length of the repayment period can
be changed to suit your budget. Perhaps you want to compare the interest rates of different lenders. Or
maybe you would consider changing the amount of the loan so that you could determine the optimum term
and monthly payment. To examine the effect of changing one of these variables use a Single Variable Data
Table. To compare the effect of changing two of the variables use a Two Variable Data Table.

The Single Variable Data Table

First create your initial function. If you wish to locate your data table elsewhere on the worksheet simply
place a copy of the original function where you want it to start. In this example the function is situated in cell
C7. You should position the function on the worksheet so that there is space in the column below it and

218
Computer literacy Program… Data Analysis using MS Excel

also to the left. Suppose you want to see the effect of different loan amounts (e.g. from £15,000 to £30,000).
Enter the list of values in the column that is to the left of the initial function, and starting in the row below it
(in this example cell A8) remembering to express the values in the same way as in the initial function.

Now select the block of data that contains the original function and the column of values you just
entered, on the Data tab of the ribbon choose What-If Analysis then Data Table to open the
Data Table tool. Click in the textbox marked Column input cell then click on the cell in that
supplied the value in the initial function that corresponds to the column of values you entered
(Fig.3). In this example it is cell B1 (the Loan Amount). Finally, click OK to dismiss the dialog and
create the table (Fig.4). Here the result cells have been formatted to show only two decimal places.

The Two-Variable Data Table


When comparing two different variables you need to provide a column and a row of variable values. This
time enter the column of values directly beneath the initial function (here starting in cell B8) and the row
immediately to the right of the initial function (here starting in cell C7). In this example the second variable
is the duration of the loan or Term in months (e.g. from 3 to 12 years expressed as 36 to 144 months). Select
the block of cells to include the initial function and the row and column of variable values and open the data

219
Computer literacy Program… Data Analysis using MS Excel

table tool. In this example the Row input cell is the one containing the Term in the initial function (cell B3)
(Fig.5). The Column input cell, representing the Loan Amount, is the same as before (cell B1).

Conditional Formatting
The mass of figures in a large data table can make it difficult to read but this can be made a lot easier with
the aid of Conditional Formatting. Unlike regular formatting, conditional formatting can change the
appearance of a cell according to the value displayed in it. Consider the example of a two-variable table
shown in the section on Data Tables. Suppose your criteria for a loan were that the monthly repayment was

220
Computer literacy Program… Data Analysis using MS Excel

between £300 and £350. There are numerous cells in the table whose values fall in that range but it is
difficult to find them, and the table will change if any of the other variables in the calculation are changed.
It’s an ideal candidate for conditional formatting. In this example (Fig.7) three different conditional formats
have been applied to the data table. Cells displaying values greater than £350 are shown in red (these are
beyond the upper end of my price range - I can’t afford them); cells displaying values less that £300 are
shown in yellow (these are below the lower end of my price range - I can afford a higher payment); and cells

whose values fall between £300 and £350 are shown in green (these are the ones I am interested in).

To apply this kind of conditional formatting:

1. Select the cells to be formatted.

2. Go to the Data tab and click the Conditional Formatting button then choose Highlight
Cells Rules then Greater Than…

3. In the Greater Than dialog box enter a value above which the cells should display a certain
format, in this example 350. Notice that as you do so Excel displays a preview of the
chosen format on your data (Fig.8).

4. Choose a preset format from the drop-down list (in this example Light Red Fill with Dark
Red Text was chosen) or choose Custom Format and devise your own format.

5. Click OK to apply the first format rule and close the dialog box. Leave the cells selected.

6. Repeat the procedure on the same range of cells, this time choose Conditional

221
Computer literacy Program… Data Analysis using MS Excel

Formatting > Highlight Cells Rules > Less Than… and in the Less Than dialog box enter 300 and choose
Yellow Fill with Dark Yellow Text.

7. Click OK to apply the second format rule and close the dialog box. Leave the cells selected.

8. Repeat the procedure on the same range of cells and choose Conditional Formatting >
Highlight Cells Rules > Between… and in the Between dialog box enter 300 and 350
and choose Green Fill with Dark Green Text.

9. Finally, click OK to apply the third format rule and close the dialog box.

10. When you deselect the cells you should now have a formatted range of cells looking
something like that shown here (Fig.7).

You don’t have to apply several different formats. You may just want to highlight cells that satisfy a
particular condition.

When applying multiple conditional formats you are not limited to just three conditions as in this example.
You can add as many as you need but remember to apply all your formats to the same range of cells. Make
sure that your format rules do not conflict. For example, if you choose Greater than 100 as one rule and
Greater Than 200 as another rule, which of the rules should apply to a cell showing a value of 250 since both
rules apply? (You can in fact specify a rule for this dilemma using the Manage Rules tool but if you are new
to conditional formatting it is best to avoid conflicts in the first place!)

In addition to using regular formatting tools such as cell fill colours and font colours as in the previous
example, Excel offers a range of Icon Sets, Data Bars and Colour Scales to denote specified cell values. You
can apply these directly to your data but it is more likely that you will want to specify your own particular
conditions. Excel allows you to do this using the Manage Rules tool.

Using Custom Conditional Formats

Using the previous example, you might choose to apply the Traffic Light icon set instead of fill and font
formatting. To do this first apply your chosen icon set by going to Conditional Formatting > Icon Sets and
choose an icon set from the list, in this case the three-colour traffic light set. Excel applies the icon set to the
data but at the same time applies its own rule for which value range each colour represents (Fig.9).

222
Computer literacy Program… Data Analysis using MS Excel

NOTE: When you apply an icon set you might find that your cell values are replaced by hash marks
(#####). This simply means that in order to make room for the icon the number cannot be properly
displayed. Simply widen each column to allow the values to be shown.

To specify your own rules go to Conditional Formatting > Manage Rules. In the Conditional Formatting
Rules Manager select your chosen rule and click Edit Rule

Because there are three icon colours in this set Excel has created its own rule dividing the range of values
into three by percent (>=67% green, <67% and >=33% yellow, <33% red) but I want the colours to apply to
specific numerical ranges and in a different order with red representing the
highest values.

In the Edit Formatting Rule dialog I could simply click the Reverse Icon Order button but this

would make the middle range yellow and I want that one to be green, the same as I had in the

previous example. Fortunately Excel lets me specify which icon applies to each range. Making sure that
Format all cells based on their values is selected, all I have to do is select the appropriate icon from the Icon

223
Computer literacy Program… Data Analysis using MS Excel

dropdown, choose my operator (>= or >) and enter a value in the Value box and choose Number from the
Type dropdown (Fig.10).

224
Computer literacy Program… Data Analysis using MS Excel

Fig.10 Creating a custom conditional formatting rule.

After clicking OK to dismiss the dialogs and apply the modified rule the data appears with the same colours
as before but using traffic light icons instead of fill and font colours (Fig.11).

Excel 2007
Creating Pivot Tables

Introduction

PivotTable reports, or PivotTables as they are often called, can help you answer questions about your
spreadsheet by analyzing the numerical information in various ways. If you work with spreadsheets with a
lot of data, a PivotTable can be an extremely useful tool. PivotTable reports give you power because you
can quickly find the answer to many different questions and can manipulate your data in many different
ways.

In this lesson, you will learn the basics of inserting and working with PivotTable reports.

PivotTable reports

Why are they named PivotTables?

You may be wondering why it is called a PivotTable. Basically, PivotTables allow you to pivot, or move,
data so you can produce answers to questions. Once you create a PivotTable, you can very easily see
what effect pivoting the data has on the spreadsheet information.

To create a PivotTable report

Select the cells in your spreadsheet that you want to use in the PivotTable report.

Select the Insert tab.

Click the PivotTable command.

225
Computer literacy Program… Data Analysis using MS Excel

Click PivotTable again. Excel selects cells in the actual spreadsheet, and the Create PivotTable dialog
box opens.

Select a table or range is already selected, and the Table/Range field shows the range of the selected
data. New Worksheet is also selected by default as the place where the report will be placed.

Click Existing Worksheet, then select a worksheet if you do not want the PivotTable to appear in a new
worksheet.

Click OK.

Creating a PivotTable report

If you use the sample spreadsheet to create a PivotTable, you can see that the column headings are
salesperson, region, account, order amount, and month. When you create a PivotTable, each column
label in your data becomes a field that can be used in the report. The Field List appears on the right side
of the report, while the layout area appears on the left.

226
Computer literacy Program… Data Analysis using MS Excel

To create a PivotTable report

Determine what question you want your PivotTable report to answer. For example, using the sample
spreadsheet, you might want to know which salesperson sold the highest dollar amount.

Determine the fields that are necessary to answer this question—in this example, salesperson and order
amount.

Select the check box next to the Salesperson field in the PivotTable Field List. The field will appear in
the drag-and-drop area at the bottom of the field list and in the layout area. The order amount data appears
on the right. This is a default setting in Excel—data with numbers will always appear on the right.

Select the check box next to the Order Amount field in the PivotTable Field List. The field will appear
in the drag-and-drop area at the bottom of the field list and in the layout area. All of the salesperson data
appears on the left side as rows.

You can now see the answer to your question in the report on the left.

227
Computer literacy Program… Data Analysis using MS Excel

If you change any of the data in your source worksheet, the PivotTable will not update automatically. To
manually update it, select the PivotTable and then go to Options Refresh.

To add a report filter:

Select a field in the Field List. In this example, choose Region. By default, it will appear in the Row
Labels group.

Click and drag Region into the Report Filter section.

Release the mouse button. The region appears at the top of the report as a filter.

The arrow by the Region fields shows (All). To show just the data for a specific region, click the drop-
down arrow, and select the region. To see multiple regions, click the Multiple Regions box, select the
regions to display, then click OK.

Moving, or pivoting, data:

Click and drag a field from one area to another.

228
Computer literacy Program… Data Analysis using MS Excel

Release the mouse button to drop the field in the new area. In this example, we move Region from
Report Filter to Column Label. The PivotTable report will change.

OR

Right-click one of the rows. A menu will appear.

Select Move, then select a move option.

229
Computer literacy Program… Data Analysis using MS Excel

To create a PivotChart

Select the PivotChart command from the Options tab. The Insert Chart dialog box appears.

Select the chart you’d like to insert.

Click OK. The chart will now appear on the same sheet as the PivotTable.

230
Computer literacy Program… Data Analysis using MS Excel

Learning VLOOKUP in Excel

As September approaches, I can count on a series of spreadsheet questions. One of the popular Excel
tutorial requests is how do you look up a value on one Excel worksheet and use it on another Excel
worksheet. For example, you need to translate a product number into a product name. One of my
favorite Excel functions is the VLOOKUP function and it can help with this task. (Includes Excel VLOOKUP
Example file and video in reference section.)

A recent case involved some voter registration data I needed to analyze. On one Excel spreadsheet, the
voter’s party was listed as an alphanumeric value called "Pcode" and not the political party. This coding
wasn't intuitive. For example, “D” was for “American Independent Party”, but some thought it meant
“Democratic Party”.

One way to solve this problem is to create a worksheet with the Pcode and translation and have Excel
use the VLOOKUP function for the party name. You might think of VLOOKUP as an Excel translator. I
could then add a column called “Political Party” to my original worksheet to show the information from a
lookup table.

Creating a Lookup Table

A lookup table includes the values you wish to "lookup" such as our Pcode and the translation such as
political party. You can place this table on the same worksheet, but for this Excel tutorial I'll add a
worksheet called "Political Party".

How to Create a Lookup Table,

1. Right-click your spreadsheet’s tab and select Insert…

2. On the Insert dialog, double-click Worksheet. This will be on the General tab.

3. Rename this new worksheet tab with a descriptive name such as “Party Codes”

4. In Column A, enter the unique values that exist on your main worksheet. In my example, these were
the codes that showed in the Pcode column in the thumbnail. These values should be in ascending
order.

231
Computer literacy Program… Data Analysis using MS Excel

5. In Column B, enter the translated value. You can have more values in column A than appear on your
main spreadsheet. For example, I have an entry for “Citizen Party” even though I didn’t show a
registered voter with that affiliation.

Using the VLOOKUP Function

Excel’s VLOOKUP function uses 4 pieces of information. The function panel may seem intimidating with
the terms, but it’s simpler than it looks. (Note: If you have Excel 2007 or 2010, you can find an additional
PDF file with updated screen prints in the resources section at the bottom.)

To lookup a value using VLOOKUP,

1. Add your new column on your original worksheet that will display the info pulled from the Lookup
table. In my example, I added a column called Political Party in Column D. This is where I will insert the
Excel function.

2. Place your cursor in the first blank cell in that column. In my example, this is cell D2.

3. From the Insert menu, select Function…. The Insert Function dialog will appear.

232
Computer literacy Program… Data Analysis using MS Excel

4. In the Search for a function: text box, type “vlookup” and click Go.

5. Highlight VLOOKUP and click OK.

Defining the VLOOKUP Values

After you click OK, Excel’s Function Arguments dialog appears and allows you to define the four values.
You’ll see that your starting cell and the formula bar show the beginning part of the function
=VLOOKUP(). The Function Arguments dialog adds the needed data elements that will display between
().

For illustration purposes, I have overlaid the Party Codes worksheet on top to show the relationships.

233
Computer literacy Program… Data Analysis using MS Excel

1. Lookup_value – Think of this field as your starting point. In my example, I’ll click cell C2 so the value is
filled in the dialog. I'm requesting Excel take the value of C2, which displays as the Pcode of “A”, and find
the matching political party on my lookup table on the Party Codes worksheet.

2. Table_array – This is the range for your lookup table. The range can be on your existing worksheet or
another worksheet such as our “Party Codes”. When you click another tab and define the range, Excel
prepends that tab name to the range such as ‘Party Codes’.

Rules & Caveats

There are several rules to remember about this table array.

Rule 1 - The left column must contain the values being referenced. In other words, I couldn’t have our
first column be Political Party.

Rule 2 - You can’t have duplicate values in the leftmost column of the lookup range. I couldn’t have two
entries with the value “A” with one being “Democratic” party and another “A” for the “Humanist” party.
Excel would complain.

Rule 3 - When referencing a lookup table, you don’t want your cell references to change when you
drag and fill to populate the other cells with the VLOOKUP function. As example, if I want to use the
same function in cells D3 through D7, I don’t want my lookup cell references to shift each time I move
down to the next cell. I need the cell references to be the same. After you define your range, you need
to press F4 which will cycle through absolute and relative references. You want to select the option that
includes a $ before your Column and Row. ( 'Party Codes'!$A$2:$B$45. ) You can get around this if you
know how to use Excel name ranges.

Col_index_num – This is the number of the column on your lookup table that has the information you
need. In our example, we want column 2 from the Party Codes worksheet which has the name of the
political party.

Range-lookup – this field defines how close a match should exist between your Lookup_value (C2) and
the value in the leftmost column on our lookup table. In our case, we want an exact match so we’ll use
“FALSE”.

After clicking various cells, my dialog looks like


this:

You can see in the circled formula bar above, I


now have more information based on my entries
in the Function Arguments dialog box.

The other item of interest is that when you build


these functions, Excel displays the result in the
Formula result = text line. This is great feedback
which can show if your function is on target. In
our example, we can see Excel looked up the Pcode of “A” and returned the Political Party “Democratic”.

234
Computer literacy Program… Data Analysis using MS Excel

Copying the VLOOKUP Function to Other Cells

It doesn’t make sense to use VLOOKUP for one cell in your Excel spreadsheet. Instead, I want to copy the
function to other cells in the same column.

To copy VLOOKUP to other column cells,

1. Click the cell containing the VLOOKUP arguments. In our example, this would be D2.

2. Grab the cell handle that displays in the lower right corner.

3. Left-click and drag down the cell handle to cover your column range.

Note: If I hadn’t changed to absolute reference as mentioned in Rule 3, I would’ve seen my table array
entry shift by one cell as we dragged down through the other cells.

VLOOKUP is a powerful Excel function that can leverage spreadsheet data from other sources. There are
many ways you can benefit from this function. In this example, I used a 1:1 code translation, but you
could also use it for group assignments. For example, you could assign state codes to a region such as CT,
VT, and MA to a region called “New England”.

COUNTIF function

Description

The COUNTIF function counts the number of cells within a range that meet a single criterion that you
specify. For example, you can count all the cells that start with a certain letter, or you can count all the
cells that contain a number that is larger or smaller than a number you specify. For example, suppose you
have a worksheet that contains a list of tasks in column A, and the first name of the person assigned to
each task in column B. You can use the COUNTIF function to count how many times a person's name
appears in column B and, in that way, determine how many tasks are assigned to that person. For
example:

=COUNTIF(B2:B25,"Nancy")

Note To count cells based on multiple criteria, see COUNTIFS function.

Syntax

COUNTIF(range, criteria)

The COUNTIF function syntax has the following arguments:

 range Required. One or more cells to count, including numbers or names, arrays, or references
that contain numbers. Blank and text values are ignored.
 criteria Required. A number, expression, cell reference, or text string that defines which cells
will be counted. For example, criteria can be expressed as 32, ">32", B4, "apples", or "32".

235
Computer literacy Program… Data Analysis using MS Excel

Notes

 You can use the wildcard characters — the question mark (?) and the asterisk (*) — in criteria. A
question mark matches any single character, and an asterisk matches any sequence of characters.
If you want to find an actual question mark or asterisk, type a tilde (~) before the character.
 Criteria are case insensitive; for example, the string "apples" and the string "APPLES" will match
the same cells.

Example 1: Common COUNTIF formulas

The example may be easier to understand if you copy it to a blank worksheet.


# A B C

1 Data Data

2 apples 32

3 oranges 54

4 peaches 75

5 apples 86

6 Formula Description Result

7 Number of cells with apples in cells A2


=COUNTIF(A2:A5,"apples") 2
through A5.

8 Number of cells with peaches in cells A2


=COUNTIF(A2:A5,A4) 1
through A5.

9 =COUNTIF(A2:A5,A3)+ Number of cells with oranges and apples in


3
COUNTIF(A2:A5,A2) cells A2 through A5.

10 Number of cells with a value greater than 55


=COUNTIF(B2:B5,">55") 2
in cells B2 through B5.

11 Number of cells with a value not equal to 75


=COUNTIF(B2:B5,"<>"&B4) 3
in cells B2 through B5.

12 Number of cells with a value greater than or


=COUNTIF(B2:B5,">=32")-
equal to 32 and less than or equal to 85 in 3
COUNTIF(B2:B5,">85")
cells B2 through B5.

COUNTIF formulas using wildcard characters and handling blank values


# Formula Description Result

236
Computer literacy Program… Data Analysis using MS Excel

1 Number of cells ending with the letters "es"


=COUNTIF(A2:A7,"*es") 4
in cells A2 through A7.

2 Number of cells ending with the letters "les"


=COUNTIF(A2:A7,"?????es") and having exactly 7 letters in cells A2 2
through A7.

3 Number of cells containing any text in cells


=COUNTIF(A2:A7,"*") 4
A2 through A7.

4 Number of cells not containing text in cells


=COUNTIF(A2:A7,"<>"&"*") 2
A2 through A7.

5 =COUNTIF(B2:B7,"No") / The average number of No votes (including 0.3333


ROWS(B2:B7) blank cells) in cells B2 through B7. 33333

6 =COUNTIF(B2:B7,"Yes") / The average number of Yes votes


(ROWS(B2:B7) -COUNTIF(B2:B7, (excluding blank cells) in cells B2 through 0.5
"<>"&"*")) B7.

237
Computer literacy Program… Data Analysis using MS Excel

Fill in the blanks.

1. The home tab has sections.


2. Default paper size is .
3. Excel calculations expressions start with .
4. The allows to cut, copy paste.
5. The number section provides the options for numbers.

M.C.Q.

1. Formula in Ms. Excel begin with an sign.


(i) = (ii) # (iii) ()

2. The Proofing section provides the .


(i) Spell & grammar, (ii) save, (iii) Help

3. = Today () = ___________________
(i) Day, (ii) Hours, (iii) Date

4. The view tab has sections which include workbook views, show
hide zoom
(i) 4 (ii) 3 (iii) 5

5. The function is used to add up the values


(i) if (ii) sum if (iii) Product

Short answer questions.

1. Define formula bar?


2. How to apply v look formula?
3. How to create pie chart?
4. How to apply header & footer?
5. What is the purpose of Ms. Excel?

238
Computer literacy Program… Data Analysis using MS Excel

Fill in the blanks.

1. section provides the standard spelling & grammar check.


2. paper size is the default selection.
3. function is used to find specific information that has been
stored in a spread sheet table.
4. Is an important aspect of planning & managing any
business.
5. Tool provides a quick & easy way to perform “what if” analysis.
Multiple choice questions.

1. You can choose types of numbers data percentage in option.


1) Number 2) Style 3) Text

2. Section has option for pivot table and charts & tables.
1) Table 2) Charts 3) Table & Charts

3. Allow you to create name or variable to be referenced in


others areas

1) Functions 2) Defined name 3) Formula auditing

4. There are by default sheets in excel work book


1) 1 2) 3 3) 4

5. will show the grids around each cell.


1) Grid lines 2) tables 3) sheet

Short questions:

1. Why macro is used?


2. How to insert a header?
3. Why what if analysis is used?
4. What is PV in PMT function?
5. What is difference between single & two variable data table.

239

You might also like