Microsoft Excel 2010: Data Manipulation
Microsoft Excel 2010: Data Manipulation
Microsoft Excel 2010: Data Manipulation
2010
Data Manipulation
February 2011
Microsoft Excel 2010 – Data Manipulation
Table of Contents
IMPORTING TEXT FILES ......................................................................................................... 4
WHAT IS A DELIMITED TEXT FILE? ......................................................................... 4
IMPORTING A DELIMITED TEXT FILE ....................................................................... 4
NAMED RANGES ........................................................................................................................ 9
NAMING CELL RANGES ..................................................................................... 9
REMOVING A NAMED RANGE ............................................................................. 11
NAMED CELL RANGES AND FUNCTIONS ................................................................. 12
SORTING AND FILTERING DATA ....................................................................................... 13
SORTING DATA BY MULTIPLE COLUMNS AT THE SAME TIME ........................................... 13
APPLYING A PRE-INSTALLED CUSTOM SORT ........................................................... 16
CREATING A CUSTOMIZED LIST AND PERFORMING A CUSTOM SORT ................................. 19
REMOVING A CUSTOMIZED LIST ......................................................................... 22
USING AUTOFILTER ...................................................................................... 24
USING AUTOFILTER TO PERFORM MULTIPLE QUERIES ................................................ 28
TOP 10 AUTOFILTER ..................................................................................... 31
REMOVING ALL AUTOFILTERS FROM A WORKSHEET .................................................. 33
ADVANCED FILTER CRITERIA ............................................................................ 34
SUB-TOTALING............................................................................................ 36
REMOVING SUBTOTALS .................................................................................. 39
EXPANDING AND COLLAPSING OUTLINE DETAIL LEVELS ............................................... 41
LINKING & EMBEDDING ...................................................................................................... 44
WHAT IS EMBEDDING AND LINKING? .................................................................... 44
LINKING DATA WITHIN A WORKSHEET ................................................................... 44
LINKING CELLS BETWEEN WORKSHEETS WITHIN A WORKBOOK ....................................... 46
LINKING DATA BETWEEN WORKBOOKS.................................................................. 47
LINKING DATA FROM EXCEL TO A WORD DOCUMENT .................................................. 48
LINKING AN EXCEL CHART TO A WORD DOCUMENT ................................................... 49
UPDATING, LOCKING AND BREAKING LINKS............................................................. 51
Page 3 of 56 Software Training & Support
Dallas County Community College District
A common example used to supply mail merge addresses, is a CSV file format, in
which the delimiter is a comma.
When you open a delimited, text formatted file within Excel, it will automatically try
to recognize the type of delimitation used and display the relevant data in the
familiar column and row format, used by Excel.
Double click on a folder called Excel 2010 Advanced Course to display the
contents of your sample files folder.
LeCroy Center Page 4 of 56
Microsoft Excel 2010 – Data Manipulation
Click on the down arrow next to the Files of type section and select All Files.
Select a text file called Delimited Text. This file uses Tab delimitation.
TIP: Tab delimitation, means that each item within this text file is separated
from the next item in a row by a tab.
Page 5 of 56 Software Training & Support
Dallas County Community College District
Click on the Open button. You will see the Text Import Wizard (Step 1 of 3)
dialog box, as illustrated.
Notice that the dialog box has two areas, the upper referring to choices you can
make, the lower showing the data you are about to import. The wizard looks at
your source data and the original file format and determines whether it is
delimited or not. You can choose to alter this decision if you wish.
Click Next and the Text Import Wizard (Step 2 of 3) dialog box is displayed.
The upper half of this box allows you to select the required field delimiter. The
default is Tab.
Make the appropriate choice(s) as more than one can be selected. I.e. select
items, such as Space, Comma or Tab.
LeCroy Center Page 6 of 56
Microsoft Excel 2010 – Data Manipulation
When you have chosen your delimiter the data display in the lower half of the
dialog box shows the effect.
When this is as you want click on the Next button. The Text Import Wizard
(Step 3 of 3) dialog box is displayed.
You now select the data format for each of the columns. You can also decide
whether you wish to import a column or not.
When you have made your decisions, click on the Finish button to import the
text into your spread sheet. The data should be neatly separated into columns,
as illustrated below.
NOTE: You may have to widen the columns to accommodate the data.
Page 7 of 56 Software Training & Support
Dallas County Community College District
Click on the Save button in the Quick Access Toolbar. The following dialog will
be displayed. Read this dialog carefully.
Click on the No button. The Save As dialog box will be displayed. Enter the file
name My Text File and then click on the Save button.
LeCroy Center Page 8 of 56
Microsoft Excel 2010 – Data Manipulation
Named Ranges
Naming cell ranges
Open a file called Named Ranges 01.
We are going to give a name to the Quantity Sold range.
Select the range to be named, in this case cell B4:B9.
Click in the Name Box (to the top-left of your screen) with the mouse and enter
the name you want to give to the cell(s), in this case Quantity_Sold, and press
Enter. (If you see an error message, this is because you did not place an
underscore character between the words Quantity and Sold).
Page 9 of 56 Software Training & Support
Dallas County Community College District
We are now going to name the range for the Price per Item.
Click on cell E3.
Click in the Name Box with the mouse and enter the name for the range, in this
case Price_per_item, and press Enter. (If you see an error message, this is
because you did not place an underscore character between the words).
If you click on the down arrow, next to the Name Box, you will see both
named ranges listed.
Within Excel functions you may now reference the name of these ranges, rather
than have to specify the cell range. This makes understanding functions much
easier.
LeCroy Center Page 10 of 56
Microsoft Excel 2010 – Data Manipulation
Click on a Formulas tab and within the Defined Names group, click on the
Name Manager button.
The Name Manager dialog box will be displayed. Select the named range that
you wish to delete, such as Quanity_Sold and then click on the Delete button.
Click on the Close button to close the Name Manager dialog box.
Page 11 of 56 Software Training & Support
Dallas County Community College District
As you can see the function automatically used the name of the range, within the
function syntax.
=SUM(Quantity_Sold)
LeCroy Center Page 12 of 56
Microsoft Excel 2010 – Data Manipulation
Click on the Data tab and within the Sort And Filter group click on the Sort
button.
Page 13 of 56 Software Training & Support
Dallas County Community College District
Click on the down arrow to the right of the Sort by section of the dialog box,
and select Second-name. Within the Order section of the dialog box make sure
the order is set to A to Z.
LeCroy Center Page 14 of 56
Microsoft Excel 2010 – Data Manipulation
Click on the down arrow to the right of the Then by section of the dialog box,
and select First-name. Make sure that the A to Z order option is selected.
Click on the OK button and the data will be sorted by second name and then by
first name, as illustrated. You can more clearly see the effect by looking at the
way the people called Smith are sorted.
Page 15 of 56 Software Training & Support
Dallas County Community College District
This worksheet contains details for a small air travel company, operating flights
to different countries that leave on specific days of the week. We wish to sort
the data by the days of the week.
The easy way to do this is to click within the Day Flights Available column and
then click on the Data tab and click on the A-Z Sort button (within the Sort &
Filter group).
If we click on the A-Z Sort button you will see the following, which is not really
what we want.
LeCroy Center Page 16 of 56
Microsoft Excel 2010 – Data Manipulation
This will display the Sort dialog box. In the Sort by section of the dialog box
make sure that Day Flights Available is selected.
Page 17 of 56 Software Training & Support
Dallas County Community College District
Click on the down arrow to the right of the Order section and select Custom
List.
LeCroy Center Page 18 of 56
Microsoft Excel 2010 – Data Manipulation
If we click on this Sort button you will see the following, and which is not what
we want. The results of an A-Z sort will look like this.
Excel is supplied with a list of custom sort collections, but we need to create a
new custom list to sort the planets by distance from the Sun.
Page 19 of 56 Software Training & Support
Dallas County Community College District
Click on the Data tab and within the Sort And Filter group click on the Sort
button.
This will display the Sort dialog box. In the Sort by section of the dialog box
make sure that Planets of the Solar System is selected.
Click on the down arrow to the right of the Order section and select Custom
List.
LeCroy Center Page 20 of 56
Microsoft Excel 2010 – Data Manipulation
This will display the Custom Lists dialog box. Select New List as illustrated.
Page 21 of 56 Software Training & Support
Dallas County Community College District
Click on the OK button to close the Custom List dialog box. The Sort dialog
box will now look like this.
The list will now be sorted in order of distance from the Sun.
LeCroy Center Page 22 of 56
Microsoft Excel 2010 – Data Manipulation
This will display the Sort dialog box. In the Sort by section of the dialog box
make sure that Planets of the Solar System is selected.
Click on the down arrow to the right of the Order section and select Custom
List. This will display the Custom Lists dialog box. Select Planets of the solar
system as illustrated.
You may see a warning dialog box, if so click on the OK button to delete the list.
Close the document without saving any changes that you may have made to the
document.
Page 23 of 56 Software Training & Support
Dallas County Community College District
Using AutoFilter
Open a workbook called
AutoFilter 01.
The display will change as illustrated. We can click on the down arrows
displayed to apply filters to the data.
LeCroy Center Page 24 of 56
Microsoft Excel 2010 – Data Manipulation
To see only sales relating to the North region, click on the down arrow in the
Region column and click on the check box next to Select All.
Page 25 of 56 Software Training & Support
Dallas County Community College District
You will then only see sales relating to the North region.
Experiment with filtering the Units Sold column. Let's say you want to only
display details for sales people that have sold more than 11 units. Click on the
down arrow in the Units Sold column, and select the Number Filters
command. From the sub-menu displayed select Custom Filter.
LeCroy Center Page 26 of 56
Microsoft Excel 2010 – Data Manipulation
Click on the OK button and the filtered list will look like this.
Page 27 of 56 Software Training & Support
Dallas County Community College District
You can use AutoFilter to perform a query using multiple criteria. For instance
you can filter the list to only show sales within the North region of more than 11
units.
Click within the data table.
Click on the Data tab and within the Sort & Filter group click on the Filter
button
The display will change as illustrated. We can click on the down arrows
displayed to apply filters to the data.
LeCroy Center Page 28 of 56
Microsoft Excel 2010 – Data Manipulation
Click on the down arrow in the Units_Sold column and select Number Filters.
From the sub-menu menu displayed click on Custom Filter.
Page 29 of 56 Software Training & Support
Dallas County Community College District
The Custom AutoFilter dialog box is displayed. Click on the down arrow in
the Units_sold section of the dialog box, and select is greater than.
Type the number 11 into the text box in the right hand section of the dialog box.
The dialog box should now look like this.
LeCroy Center Page 30 of 56
Microsoft Excel 2010 – Data Manipulation
Top 10 AutoFilter
Open a workbook called Top 10 AutoFilter.
Click within any cell within the list.
Click on the Data tab and within the Sort & Filter group click on the Filter
button
Page 31 of 56 Software Training & Support
Dallas County Community College District
Click on the OK button and you will see the top 5 entries listed, as illustrated.
You can then sort these in descending order. To do this click on the AutoFilter
down arrow in the Units_Sold column and click on the Sort Largest to
Smallest command.
LeCroy Center Page 32 of 56
Microsoft Excel 2010 – Data Manipulation
Page 33 of 56 Software Training & Support
Dallas County Community College District
Enter the following (i.e. "Agustín" and "UK") into the criteria area beneath the
list.
This will display the Advanced Filter dialog box. Excel should have
automatically entered your list range into the List range box.
LeCroy Center Page 34 of 56
Microsoft Excel 2010 – Data Manipulation
We wish to filter according to the criteria in cells A25:D26, so click within the
Criteria range box and enter $A$25:$D$26.
Click on the OK button and Excel will filter the list, showing only records that
match your criteria.
Page 35 of 56 Software Training & Support
Dallas County Community College District
Sub-totaling
Open a workbook called Subtotals 01.
LeCroy Center Page 36 of 56
Microsoft Excel 2010 – Data Manipulation
Page 37 of 56 Software Training & Support
Dallas County Community College District
Use the settings illustrated in the dialog box, and then click on the OK button.
The data will now display subtotals.
LeCroy Center Page 38 of 56
Microsoft Excel 2010 – Data Manipulation
Removing subtotals
Open a workbook called
Subtotals 02. This contains a
list displaying subtotals.
Page 39 of 56 Software Training & Support
Dallas County Community College District
Click on the Remove All button. The data will now look like this.
LeCroy Center Page 40 of 56
Microsoft Excel 2010 – Data Manipulation
The numbers at the top of the column allow you to expand or collapse all the
groups at a level simultaneously.
Page 41 of 56 Software Training & Support
Dallas County Community College District
The sales for each region have now collapsed so that only the total sales are
displayed.
Click on the number 1 level.
Now the region totals have collapsed, leaving just the grand total.
Click on the number 3 level to expand all the groups once more.
LeCroy Center Page 42 of 56
Microsoft Excel 2010 – Data Manipulation
The East Total group has been collapsed, leaving just the total for the group.
Expand the East Total group by clicking on the + (plus) icon displayed to the
left of the East Total.
Page 43 of 56 Software Training & Support
Dallas County Community College District
TIP: Adding the $ symbols makes the reference an absolute reference, rather
than a relative reference, so that if you extend a series containing these
references they will still point to the absolute cell reference containing the price
for postage and packing.
LeCroy Center Page 44 of 56
Microsoft Excel 2010 – Data Manipulation
Copy this formula to cells C8:C11 (by clicking on cell C7, moving the pointer to
the bottom-right of the cell, until the mouse pointer changes to the shape of a
small cross, and then dragging down to cell C11). The worksheet should then
resemble the illustration shown.
Click on cell A3 and change the value to 3.0. This should automatically change
the data in the “postage and packing” column data. This demonstrates the
advantage of linking data - it saves the time it would take to change each value
individually.
Page 45 of 56 Software Training & Support
Dallas County Community College District
This formula established a link between the two worksheets, within the
workbook. Switch to the second worksheet and change the postage from 2.50
to 3.00. Switch back to the first worksheet and you will see that the data has
been automatically updated.
Save your changes and close the workbook.
LeCroy Center Page 46 of 56
Microsoft Excel 2010 – Data Manipulation
Try altering the data in the first workbook and you will see that the data within
the second workbook also changes.
Save your changes and close both workbooks.
Page 47 of 56 Software Training & Support
Dallas County Community College District
LeCroy Center Page 48 of 56
Microsoft Excel 2010 – Data Manipulation
Click on the Paste Link button and then click on the OK button. The data will be
displayed within Word.
Switch back to Excel and change some of the sales values.
Switch back to Word and the changes that you made within the Excel workbook,
will be displayed within the Word document, showing that the data displayed
within the Word document is linked to the data within the Excel workbook.
Save your Word document into the folder containing your sample files for this
course. Use the file name My Linked Excel Data.
Save your changes to the Excel worksheet and close the workbook.
Page 49 of 56 Software Training & Support
Dallas County Community College District
Click on the Paste Link button and then click on the OK button. The chart will
be displayed within Word.
Switch back to your Excel workbook. Change some of the data values within the
Excel workbook and the chart will change within Word.
Switch back to your Word document and you will see that the chart has also
changed within your Word document. This shows that the chart displayed within
the Word document is linked to the chart within Excel.
Save your word document into the folder containing your sample files for this
course. Use the file name My Linked Excel Chart.
Save your changes to the workbook and close the workbook.
LeCroy Center Page 50 of 56
Microsoft Excel 2010 – Data Manipulation
TIP: Remember that this document is stored in a folder called Excel 2010
Advanced Course, contained within the Documents folder.
Page 51 of 56 Software Training & Support
Dallas County Community College District
Click on the Paste Special link and then click on the OK button. The linked
table data will now be displayed within your Word document.
LeCroy Center Page 52 of 56
Microsoft Excel 2010 – Data Manipulation
Within the Microsoft Word document, right click on the table data and from the
pop-up menu displayed, click on the Linked Worksheet Object command.
From the sub-menu displayed click on the Links command.
Page 53 of 56 Software Training & Support
Dallas County Community College District
You will see a number of buttons that allow you to control the way the link from
Excel works.
Update Now: Will force the object within word to update to take account of any
changes made to the original data within Excel.
Break Link: Breaks the link between the chart displayed within the Word
document with the original data within the Excel worksheet.
Locked: In addition there is a check box called Locked, which allows to you
temporarily stop the updating of the chart displayed within the Word document,
even if changes are made to the original data within Excel.
Click on the Break Link button. You will see a warning dialog box displayed.
LeCroy Center Page 54 of 56
Class registration and schedule:
http://helpdesk.dcccd.edu
or
www.dcccd.edu
Employees > Training and Development > Software Training and Support
Dallas TeleCollege at the R. Jan LeCroy Center for Educational Telecommunications
District Software Training & Support
9596 Walnut St. Dallas, TX 75243
STAFF Helpdesk Phone: 972‐669‐6477
STUDENT Helpdesk Phone: 972‐669‐6402
Email: [email protected]
Support Web Site: http://helpdesk.dcccd.edu
Training Web Site: http://employeetraining.dcccd.edu/