0% found this document useful (0 votes)
39 views23 pages

2) Ms. Excel - Importing Exporting Data (By Tahir Aziz)

Uploaded by

jalalarain700
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)
39 views23 pages

2) Ms. Excel - Importing Exporting Data (By Tahir Aziz)

Uploaded by

jalalarain700
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/ 23

HANDS-ON COURSE

EXCEL: IMPORTING &


EXPORTING DATA

By Tahir Aziz
Hands on Course - Ms. Office by Tahir Aziz Ms. Excel: Importing & Exporting Data

1 INTRODUCTION TO MANAGING DATA


Excel has many features for summarizing, analysing, presenting data in the form of reports and charts.
To get benefit of these features you can store data in two ways.

• Storing the data directly in the Excel workbook


• Storing data in an external data source and importing through a connection

Storing the data directly in the Excel workbook

Storing the data directly in the Excel workbook has benefit of speedily access of data, direct control and
easy access of data.

However, managing the data being stored in Excel file may put difficulties as file becomes larger in size.
Duplicate copies of Excel file will be created while sharing the data with others which may confuse the
users about the original and updated data.

Storing data in an external file

Many organisations store single copy of data in well managed and secure external sources e.g
databases, online analytical processing (OLAP) cubes, text files etc.

Excel makes it possible to query data lists (tables) stored in external databases to which you have
access and then extract the data that interests you into your worksheet for further manipulation and
analysis. The external data source is connected to the workbook through a data connection, which is a
set of information that describes how to locate, log in, query, and access the external data source. You
can get the data updated by refreshing the connection.

Connection
External Excel
File Workbook
Data Source

Connection information can either be stored in the workbook or in a connection file, such as an Office
Data Connection (ODC) file (.odc).
Data source may have an associated Open Database Connectivity (ODBC) driver or Object Linking and
Embedding Database (OLE DB) provider. The terms ODBC driver and OLE DB connection describe the
interface that connects a database with an application such as an Excel workbook. OLE DB is a more up-
to-date and versatile method than ODBC.

Excel also makes it easy to acquire data from a variety of different data sources, including:
• Microsoft Access database files,
• Web pages on the Internet,
• Text files, and
• Other data sources such as database tables on SQL Servers and Analysis Services,
• XML data files and
• OData Data feeds.

RISE Premier School of Accountancy Page 2


Hands on Course - Ms. Office by Tahir Aziz Ms. Excel: Importing & Exporting Data

2 IMPORTING DATA
You can import data into Excel workbook from different sources. The common source is text files. Text
file may be of two types i-e

• .txt fields are separated by Tab or sometimes with other characters such as space etc.
• .csv fields are separated by commas.

Tab delimited file:


Fields are
separated by Tab

CSV file: Fields are


separated by
commas

Data in these files can be opened into Excel file by any of the following methods.

Opening the .csv file directly in Excel:

1. Open Excel > go to File tab > Open > Browse


2. In Open dialogue box, change the file type from All Excel Files to Text Files.
3. Select the required file and click Open

Alternatively, you can go to the folder in which file is placed, right click on file > Open with > select
Excel to open the text file in Excel.

Text import wizard (explained later) will be opened where you can set options to open the data in
Excel worksheet in appropriate format. In this way, original file is opened and no connection is created.
All amendments to the file are updated in the original file.
RISE Premier School of Accountancy Page 3
Hands on Course - Ms. Office by Tahir Aziz Ms. Excel: Importing & Exporting Data

Importing .csv or .txt file by making a connection:

When you make a connection to the source file using Text import wizard, copy of data is created in
your workbook and a connection is developed which can later be refreshed to get updated data from
source file.

Go to Data tab > Get External Data group > From Text

Click here

Browse and select the file and click Import.

Text Import Wizard will be opened involving three steps.

RISE Premier School of Accountancy Page 4


Hands on Course - Ms. Office by Tahir Aziz Ms. Excel: Importing & Exporting Data

Step 1 of 3:

• Original data type: If items in the text file are separated by tabs, colons, semicolons, spaces, or
other characters, select Delimited. If all of the items in each column are the same length, select
Fixed width.
• Start import at row: Type or select a row number to specify the first row of the data that you want
to import.
• File origin: Select the character set that is used in the text file. In most cases, you can leave this
setting at its default.
• Preview of file: This box displays the text that will appear when it is separated into columns on the
worksheet.

RISE Premier School of Accountancy Page 5


Hands on Course - Ms. Office by Tahir Aziz Ms. Excel: Importing & Exporting Data

Step 2 of 3 (Delimited data)

• Delimiters: Select the character that separates values in your text file. If the character is not listed,
select the Other check box, and then type the character in the box that contains the cursor. These
options are not available if your data type is Fixed width.
• Treat consecutive delimiters as one: Select this check box if your data contains a delimiter of more
than one character between data fields or if your data contains multiple custom delimiters.
• Text qualifier: Select the character that encloses values in your text file. When Excel encounters
the text qualifier character, all of the text that follows that character and precedes the next
occurrence of that character is imported as one value, even if the text contains a delimiter
character.
• Data preview: Review the text in this box to verify that the text will be separated into columns on
the worksheet as you want it.

Step 2 of 3 (Fixed width data)

• Data preview: Set field widths in this section. Click the preview window to set a column break,
which is represented by a vertical line. Double-click a column break to remove it, or drag a column
break to move it.

RISE Premier School of Accountancy Page 6


Hands on Course - Ms. Office by Tahir Aziz Ms. Excel: Importing & Exporting Data

Step 3 of 3

• Click the Advanced button to do one or more of the following:


➢ Specify the type of decimal and thousands separators that are used in the text file. When the
data is imported into Excel, the separators will match those that are specified for your location
in Regional and Language Options or Regional Settings (Windows Control Panel).
➢ Specify that one or more numeric values may contain a trailing minus sign.
• Column data format: Click the data format of the column that is selected in the Data preview
section. If you do not want to import the selected column, click Do not import column (skip).

After you select a data format option for the selected column, the column heading under Data preview
displays the format. If you select Date, select a date format in the Date box.

Choose the data format that closely matches the preview data so that Excel can convert the imported
data correctly.

RISE Premier School of Accountancy Page 7


Hands on Course - Ms. Office by Tahir Aziz Ms. Excel: Importing & Exporting Data

Final step:

Clicking the Finish button will open the Import Data dialogue box where you can set how and where to
put the data in Excel.

Data will be imported to the Excel file through a connection.

RISE Premier School of Accountancy Page 8


Hands on Course - Ms. Office by Tahir Aziz Ms. Excel: Importing & Exporting Data

Importing from Web

You can also import data from a web page as follows.

Go to Data tab > Get External Data group > click From Web option. It will open New Web Query
dialogue box.

1) Type or paste the web page address and click Go.


2) Check the yellow arrow against tables to be imported and click Import.

3 DATA CONNECTIONS
After importing the data into Excel file, a connection is developed between Excel file and the source
file. That connection can be used in future to update the imported data whenever it’s changed in
original source file.

Finding existing connections:

You can find the connections to external data sources by opening the Existing Connections dialogue
box.

Go to Data tab > Get External Data group > Existing Connections

Click here

Click the drop-down arrow against Show in Existing Connections dialogue box to specify which
connections you want to see.

RISE Premier School of Accountancy Page 9


Hands on Course - Ms. Office by Tahir Aziz Ms. Excel: Importing & Exporting Data

The area below the said menu shows the specified connections.

RISE Premier School of Accountancy Page 10


Hands on Course - Ms. Office by Tahir Aziz Ms. Excel: Importing & Exporting Data

Workbook connections

You can display all connections in the workbook. For this, go to Data tab > Connections group > click
Connections option. It will open Workbook Connections dialogue box.

The Workbook Connections dialogue box helps you manage one or more connections to external data
sources in your workbook. You can use this dialog box to do the following:

• Add, remove and refresh connections in the workbook.


• Show where each connection is used in the current workbook.
• Display the Connection Properties dialogue box to modify data connection properties (see
Connection Properties later).

RISE Premier School of Accountancy Page 11


Hands on Course - Ms. Office by Tahir Aziz Ms. Excel: Importing & Exporting Data

Connection properties

On Workbook Connections dialogue box (shown previously), click Properties to open the Connection
Properties dialogue box. You can also access Connection Properties dialogue box from Data tab >
Connections group > Refresh All menu > Connection Properties

You can use this dialog box to control various settings for connections to external data sources, and to
use, reuse, or switch connection files.

This dialogue box has two tabs Usage and Definition. The settings on the Usage tab control the way
that the connection information is used in the workbook. The settings on the Definition tab control
how the connection information is defined and the source of the connection information, either the
workbook or a connection file.

RISE Premier School of Accountancy Page 12


Hands on Course - Ms. Office by Tahir Aziz Ms. Excel: Importing & Exporting Data

Refreshing the connection

To keep imported external data up-to-date, you can refresh it to see recent updates and deletes. The
refresh control options are available on Connection Properties dialogue box under Usage tab.

1) Automatically refresh data at timed intervals


On the Usage tab of Connection Properties dialogue box, under the Refresh Control, select the
Refresh every check box, and then enter the number of minutes between each refresh operation.

RISE Premier School of Accountancy Page 13


Hands on Course - Ms. Office by Tahir Aziz Ms. Excel: Importing & Exporting Data

2) Refresh data when you open the workbook


On the Usage tab of Connection Properties dialogue box, under the Refresh Control, select the
Refresh data when opening the file check box. You can save the workbook without saving the
external data to shrink the size of the file by ticking the option Remove data from the external
data range before saving the workbook.

3) Manually refresh the data


You may have one or more data ranges imported in the workbook. You can manually refresh the
data of all or any of the ranges whenever you want to see updated data in the workbook.
➢ Update only the selected data: Click any cell in the imported data range. Go to Data tab, in the
Connections group, click the arrow under Refresh All, and then click Refresh or press ALT+F5.
This option is only activated when you select a cell in imported data range.

➢ Update all data in the workbook: Go to Data tab, in the Connections group, click Refresh All or
Press CTRL+ALT+F5.

You can access these refresh options from Data tab > Connections group > Connections option >
Workbook Connections dialogue box.

Note: Whenever you refresh a connection manually, Import Text File dialogue box will be opened
where you have to select the source file and click Import. To avoid this step, you can do following:

Open Connection Properties dialogue box (described earlier), on Usage tab under Refresh control
untick the option Prompt for file name on refresh.

RISE Premier School of Accountancy Page 14


Hands on Course - Ms. Office by Tahir Aziz Ms. Excel: Importing & Exporting Data

Untick this
option

4 EXPORTING DATA
You can export workbook data to text files by saving the workbook as Text or CSV file. These files can
be opened in Ms. Word to further transfer the data to Ms. Word.

Exporting data to a text file:

Whenever you save a workbook as text file, data of current worksheet is saved only. However, you can
save multiple worksheets one by one with different names. Text files store the data in plain text
therefore many of Excel features like formatting, comments etc. will not be saved in text files.

1) To save a worksheet as text file, select the worksheet,

2) Go to File tab > Save As and select the location where to save the file or press F12 to open the Save
As dialogue box.
3) Change the Save as type to Text (Tab delimited) or CSV (Comma delimited)

RISE Premier School of Accountancy Page 15


Hands on Course - Ms. Office by Tahir Aziz Ms. Excel: Importing & Exporting Data

Change the
file type

Text file will look like this.

Exporting data to Ms. Word:

You can export data from Excel worksheet to a Word file by any of following methods.

• Copy data from Excel worksheet and paste into a Word file
or,
• Save Excel worksheet as Text or CSV file (described earlier), then open that file in Word as follows:
Start Ms. Word, go to File tab > Open > Browse and open the saved Text file.

Text file is
opened in Word

RISE Premier School of Accountancy Page 16


Hands on Course - Ms. Office by Tahir Aziz Ms. Excel: Importing & Exporting Data

Select the data in that file and go Insert tab > Tables group > Table menu > Covert Text to Table.

Adjust the settings on Convert Text to Table dialogue box and click OK.

Raw data will be converted to table (rows and columns) which you can format by applying the built-in
table styles from Table Tools - Design tab.

RISE Premier School of Accountancy Page 17


Hands on Course - Ms. Office by Tahir Aziz Ms. Excel: Importing & Exporting Data

Apply the suitable table


style by extending the
gallery.

5 PRESENTING DATA ON CHARTS


A chart is a tool you can use in Excel to communicate data graphically. Charts allow you to see the
meaning behind the numbers, and they make showing comparisons and trends much easier.

Creating a chart in Excel

Select the data range you want to chart, including the column titles and row labels. This range of cells
will be the source data for the chart.

Go to Insert tab > Charts group > click the appropriate chart type to select the chart from associated
menu. You can also click the Recommended Charts option to open the Insert Chart dialogue box and
click the appropriate chart to see its preview in right section. Click OK to insert it.

2: Click here

3: Select appropriate
chart and click OK

1: Select
the data

RISE Premier School of Accountancy Page 18


Hands on Course - Ms. Office by Tahir Aziz Ms. Excel: Importing & Exporting Data

To see the list of all available charts, click the All Charts tab on Insert Chart dialogue box.

Types of charts

The following charts are available in Excel 2016.

1. Column chart: used to compare values across multiple categories


2. Line chart: used to display trends in one or more variables over time.
3. Pie chart: display the contribution of each value to a total.
4. Bar chart: used to compare multiple values like column charts but these are horizontal.
5. Area chart: display difference between several sets of data over period of time.
6. Scatter chart: compares pairs of values.
7. Other charts: stock, surface, radar, treemap, sunburst, histogram, box & whisker, waterfall, combo.

Select the appropriate chart and click OK to insert the chart in worksheet. After selecting the data, you
can use Alt+F1 shortcut key to insert the default chart in the worksheet or press F11 to insert chart on
separate sheet.

Elements of chart

An inserted chart has many elements some of which are displayed by default. You can add further
elements or remove the displayed elements according to your requirement.

You can add or remove following elements to the chart by going to Chart Tools > Design tab > Chart
Layouts group > Add Chart Element menu. You can add/remove following elements to the chart. Each
of these elements has further options which can be accessed by clicking on the element and going to
More… option from sub menu.

• Axes

RISE Premier School of Accountancy Page 19


Hands on Course - Ms. Office by Tahir Aziz Ms. Excel: Importing & Exporting Data

• Axis titles
• Chart title
• Data labels
• Data table
• Error bars
• Gridlines
• Legend
• Trendline

You can add/remove these elements by clicking the Chart Element icon alongside the chart.

Modifying the chart

When you insert a chart, two extra tabs under Chart Tools i-e Design and Format tabs appear. These
can be used to modify the design and format of the chart.

Chart Tools - Design tab

Chart layouts group

Add chart element: The drop-down contains the submenus: Axes, Axis Titles, Chart Title, Data Labels,
Data Table, Error Bars, Gridlines, Legend, Lines, Trendlines and Up/Down Bars.
Quick layout: Change the overall layout of the chart quickly by choosing one of the predefined layout
options.

Chart styles group

RISE Premier School of Accountancy Page 20


Hands on Course - Ms. Office by Tahir Aziz Ms. Excel: Importing & Exporting Data

Change colors: Apply different combination of colours to the chart.


Chart styles: Apply a style to the selected chart with different look and formatting.

Data group

Switch row/column: Change the data being displayed on X-axis to be displayed on Y-axis and vice
versa.
Select data: Change the data range included in the chart.

Type group

Change chart type: Change your chart to a different chart type.

Location group

Move chart: Move the chart to another worksheet in the workbook.

Chart Tools - Format tab

Current Selection Group

Chart Element Selection Box: Select the chart element you want to format from the menu.
Format Selection: Format the selected chart element using the options in the format pane.

RISE Premier School of Accountancy Page 21


Hands on Course - Ms. Office by Tahir Aziz Ms. Excel: Importing & Exporting Data

Reset to Match Style: Clear any custom formatting from the selected element to ensure that the
formatting matches the overall theme of the workbook.

Insert Shapes Group

Shapes Gallery: A gallery containing the recently inserted or used shapes. The drop-down contains the
groups: Recently Used Shapes, Lines, Rectangles, Basic Shapes, Block Arrows, Equation Shapes,
Flowchart, Stars and Banners and Callouts.
Change Shape: Change the shape of the drawing, preserving all the formatting.

Shape Styles Group

Shape Styles Gallery: Quickly add a visual style to the selected shape or line.
Shape Fill: Fill the selected shape with a solid colour, gradient, picture or texture.
Shape Outline: Change the color, weight, or style of the selected chart element.
Shape Effects: Apply special visual effects to the chart element, such as shadows, bevels, or 3-D

WordArt Styles

WordArt Styles: Apply predefined text styles to the all or selected elements.
Text Fill: Fill the text with a solid colour, gradient, picture or texture.
Text Outline: Customise the outline of your text by choosing the colour, width and line style.
Text Effects: Add a visual effect such as shadow, glow or reflection to your text.

Arrange Group

Bring Forward: Bring the selected object forward.

RISE Premier School of Accountancy Page 22


Hands on Course - Ms. Office by Tahir Aziz Ms. Excel: Importing & Exporting Data

Send Backward: Bring the selected object backward.


Selection Pane: Displays the selection pane, containing the list of all inserted objects.
Align: Change the placement of your selected objects on the worksheet.
Group: Join objects together to move and format them as single object.
Rotate: Rotate or flip the selected object.

Size Group

Shape Height: Change the height of shape or picture.


Shape Width: Change the width of shape or picture.

RISE Premier School of Accountancy Page 23

You might also like