Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 30

Unit 2

Data
Manipulation
& Analysis
Data Input:
Importing Data
Guideline

• Importing Data

2
Importing Data

• It is important to be able to use and analyze data from a wide


variety of sources. You will learn how to import, or bring in,
data from various external sources into an Excel worksheet
and then analyze that data.

• Excel allows you to import data from a number of types of


sources, including text files, Web pages, database tables, data
stored in Word documents, and XML file.

3
Importing Data

• You need to analyze the existing workbook and the formats of


the data to be imported. It is important to have a good
understanding of the layout of the data you want to import and
how each data element will be arranged in the worksheet.

• Note: Determine whether data you import needs to be


standardized. When you import data from multiple sources into
a single workbook, the terminology used in each source might
vary slightly. To make the terminology consistent, it may be
necessary to find and replace text.

4
Importing Data- Data Types
• Even though many users keep data in databases such as Microsoft
Access, it is common to receive text files with fields of data
separated by commas.

• In addition, with the popularity of the World Wide Web, more


companies are creating HTML files and posting data on the Web as
a Web page.

• Word documents, especially those including tables of data, often


are used in business as a source of data for workbooks.

• XML also is a very popular format for data exchange.


5
Importing Data
• Excel allows you to import data made available in many formats,
including text files, Access tables, Web pages, Word documents,
and XML files.

• Importing data into Excel can create a refreshable link that can be
used to update data whenever the original file changes.

• In some cases, the data will need to be transposed, meaning that


the rows and columns need to be switched.

• You also might need to format the data, move it, or convert it from
or into a table.
6
Importing Text Files

• A text file contains data with little or no formatting. Many


programs, including Excel, offer an option to import data from
a text file, also called an ASCII text file. ASCII stands for the
“American Standard Code for Information Interchange”.

• In text files, commas, tabs, or other characters often separate


the fields. Alternately, the text file may have fields of equal
length in columnar format. Each record usually exists on a
separate line.

7
Importing Text Files

• A delimited file contains data fields separated by a selected


character, such as a comma. Such a file is called a comma-
delimited text file.

8
Importing Text Files
• A fixed width file contains data fields of equal length with
spaces between the fields. In the case of a fixed width file, a
special character need not separate the data fields.

• During the import process, Excel provides a preview to help


identify the type of text file being imported.

9
Importing from a Text File Steps
• Tap or click the first cell on the worksheet to contain the
imported data. Example: A4.

• Tap or click the ‘Get Data From Text’ button on the DATA tab
to display the Import Text File dialog box.

• If necessary, navigate to the location of the file containing


text to insert. in our case it’s called “Computers North Sales
2013.csv”. CSV refers to comma-separated values file.
Importing from a Text File Steps
• Double-tap or
double-click the
name of the file to
start the Text Import
Wizard and display
the Text Import
Wizard – Step 1 of 3
dialog box.
• Tap or click the Next
button to display the
Text Import Wizard
Step 2 of 3 dialog box
Importing from a Text File Steps
• Select the delimiter (Comma) to place a check mark in
the Comma check box and to display the data fields
correctly in the Data preview area.

• Click Tab to remove the check mark from the Tab.

• Tap or click the Next button to display the Text Import


Wizard – Step 3 of 3 dialog box.

• Tap or click the Finish button to finish importing the


selected text file and display the Import Data dialog box
Importing from a Text File Steps

• Tap or click the Properties button to display the External Data


Range Properties dialog box.

• Tap or click on the desired settings:


- Click ‘Adjust column width’ to remove the check mark from the ‘Adjust
column width’ check box.
- Click the ‘Overwrite existing cells with new data, clear unused cells’ option
button to select the option button and then tap or click the OK button to
accept the settings.

• Tap or click the OK button to import the data from the text
file into the worksheet, beginning in the selected cell.
Importing from a Text File Steps
Importing from Database

• To import data from an Access database, the first step is to make a


query of the data. A query is a way to qualify the data to import by
specifying a matching condition or asking a question of a
database.

• For example, a query can identify only those records that pass a
certain test, such as records containing numeric fields greater than
a specific amount or records containing text fields matching a
specific value.

• When Excel imports a database table, the data is placed in a table.


15
Importing Data from an Access Table
into a Worksheet
• Tap or click the first cell on the worksheet to contain the
imported data. In our case A11 or A12.
• Tap or click the ‘Get Data From Access’ button on the DATA
tab to display the Select Data Source dialog box
• Navigate to the location of the Access database file
containing the table to insert
• Tap or click the name of the file to import “Computers South
Sales 2013”.
• Tap or click the Open button to display the Import Data
dialog box.
• Tap or click the OK button to import the data in the database
to a table.
Importing Data from an Access Table
into a Worksheet
Formatting the Access Data
• Press and hold or right-click the desired cell and then tap or
click Table on the shortcut menu.
• Click ‘Convert to Range’ on the Table submenu and then click
the OK button to convert the table to a normal range.
• Right-click the row heading for row 11 to display the shortcut
menu and click Delete. You can then clear formats for the
data.
Importing Data from a Webpage into a
Worksheet
• Tap or click the first cell on the worksheet to contain the
imported data (A18)
• Tap or click the ‘Get data From Web’ button on the DATA tab
to display the New Web Query dialog box
• Type the Web page address in the Address bar, and then tap
or click the Go button to display the webpage in the preview
area, or if the webpage file is downloaded on your machine,
click browse and navigate to its location and select it.
• Tap or click the right arrow button near the data in the HTML
table to select it
Importing Data from a Webpage into a
Worksheet
Importing Data from a Word Document
into a Worksheet

• A Word document often contains data stored in a table. You


can use the Office Clipboard and Copy and Paste commands
to copy the data in the table to an Excel worksheet. On some
occasions, imported data requires a great deal of
manipulation once you import it into Excel.

• For example, the imported data may be easier to work with if


the rows and columns were switched, or transposed. In other
situations, you may find that an imported column of data
should be split into two columns.
Using Paste Special to import from
Word
• Open the file from which the data should be copied,
“Computers East Sales 2013”.
• Select the data and press CTRL+C to copy the data to the
Office clipboard.
• Exit the file and make Excel the active window.
• Tap or click the desired cell to paste into, example cell A34.
• Tap or click the Paste arrow on the HOME tab to display the
Paste gallery
• Tap or click the Paste Special command in the Paste Gallery to
display the Paste Special dialog box
Using Paste Special
Using Paste Special to import from
Word
• Tap or click the desired Paste setting and then tap or click the
OK button to paste. In this case choose Text.
Transposing pasted data from Word
• With the range to be copied selected (A34:H40), press
CTRL+C to copy the selection to the Office Clipboard
• Tap or click a cell to prepare for pasting data into that
location, cell A25.
• Tap or click the Paste arrow on the HOME tab to display
the Paste gallery.
• Tap or click the Transpose button in the Paste gallery to
transpose and paste the copied cells.
• Delete Row 25 since it contains the column headers.
• You can also clear formats if some table borders are left.
Transposing pasted data from Word
Modifying pasted data from Word
• Column A of the imported East data includes both the region and
part data. The data must be separated using Excel’s Convert Text
to Columns command so that the shop type information is in
column B.

• Before doing so, the source range for the data (A34:G38) should
be deleted because it no longer is needed. Also, the cells in the
range B25:E31 must be shifted one column to the right (if
necessary) to accommodate the part data.

• That is done by: Select the range B25:E31 and then click the Cut
button, Select cell C25 and then click the Paste button
Converting Text to Columns
• Select the cells to prepare for converting the text to columns,
A25:A31.
• Tap or click the ‘Text to Columns’ button on the DATA tab to display
the Convert Text to Columns Wizard – Step 1 of 3 dialog box
• Tap or click the Next button to accept Delimited as the file type and
to display the Convert Text to Columns Wizard – Step 2 of 3 dialog
box
• Tap or click to place a check mark next to the appropriated
delimiter (Comma) and uncheck the unnecessary delimiter (Tab)
and to display the data fields correctly in the Data preview area
• Tap or click the Finish button to close the dialog box and separate
the data
Converting Text to Columns
In-class Exercise

• Execute the instructions presented before to import data and


then calculate the Average Price per Unit for 2012 and 2013
using the imported data as input.

30

You might also like