Data Analysis with Microsoft Excel: Updated for Office 2007

(Tuis.) #1
Chapter 2 Working with Data 63

For more complicated formulas, you can enter the expressions using an
Advanced Filter.
You’ve completed your analysis of the service station data. Save and close
the workbook now.

To fi nish your work:

1 Click the Offi ce button and then click Save.
2 Click the Offi ce button again and then click Close.

Importing Data from Text Files


Often your data will be created using applications other than Excel. In that
case, you’ll want to go through a process of bringing that data into Excel
called importing. Excel provides many tools for importing data. In this
chapter you’ll explore two of the more common sources of external data:
text fi les and databases.
A text fi le contains only text and numbers, without any of the formulas,
graphics, special fonts, or formatted text that you would fi nd in a workbook.
Text fi les are one of the simplest and most widely used methods of stor-
ing data, and most software programs can both save and retrieve data in a
text fi le format. Thus, although text fi les contain only raw, unformatted data,
they are very useful in situations where you want to share data with others.
Because a text fi le doesn’t contain formatting codes to give it structure,
there must be some other way of making it understandable to a program that
will read it. If a text fi le contains only numbers, how will the importing pro-
gram know where one column of numbers ends and another begins? When
you import or create a text fi le, you have to know how the values are orga-
nized within the fi le. One way to structure text fi les is to use a delimiter,
which is a symbol, usually a space, a comma, or a tab, that separates one
column of data from another. The delimiter tells a program that retrieves the
text fi le where columns begin and end. Text that is separated by delimiters
is called delimited text.
In addition to delimited text, you can also organize data with a fi xed-
width fi le. In a fi xed-width text fi le, each column will start at the same loca-
tion in the fi le. For example, the fi rst column will start at the fi rst space in
the fi le, the second column will start at the tenth space, and so forth.
When Excel starts to open a text file, it automatically starts the Te x t
Import Wizard to determine whether the contents are organized in a fi xed-
width format or a delimited format and, if it’s delimited, what delimiter is
used. If necessary, you can also intervene and tell it how to interpret the
text fi le.
Free download pdf