Home > Articles

Excel's Lists, Names, and Filters

This chapter is from the book

This chapter is from the book

In this chapter

  • Creating Lists

  • Sorting Lists

  • Working with Names

  • Filtering Data with the AutoFilter

  • Using the Advanced Filter

  • Looking Ahead

Creating Lists

In Excel, a list is a set of data, arranged in a certain way. Many of Excel's features—the Data Form, pivot tables, filters, and others—will not work properly if data is not arranged as a list. And while other features such as charts will work with data that's not in list format, they become more difficult to use.

Furthermore, it's typical for data that has been imported into Excel from an external data source to enter the workbook in the form of a list. So, it's useful to know what a list is and how to set one up.

A list is a rectangular range of cells on a worksheet. It has one or more adjacent columns and two or more rows. The list is usually separated from other data on the worksheet by blank rows and columns.

In versions of Excel prior to Excel 2003, a list is an informal structure. It's more a way of arranging data and following a few conventions than something readily identifiable, such as a print area or a pivot table. There's no command to select or button to click to create a list.

Still, as informal as they are, list structures make it much easier to manage your data. For just one example of several in this chapter, see the section titled "Using Data Forms."

In Excel 2003, list structures remain informal, but a set of commands has been added to Excel's worksheet menu structure. These commands make it easier to set up lists, edit their data, and extend their reach. This section describes lists in general, and Excel 2003's new commands in particular.

Understanding List Structures

Lists have three fundamental characteristics, shown in Figure 3.1.

Figure 3.1Figure 3.1 The data in cells A1:C21 make up a list.

NOTE

If you've worked with a database management system such as Access, SQL Server, or even dBASE, you probably recognize the layout shown in Figure 3.1. In datasheet view, most database management systems display data in the same fashion: records occupying separate rows and fields occupying separate columns.

Notice the following in Figure 3.1:

  • The variable (also called a field) named Party is in column A, the variable Sex is in column B, and the variable Age is in column C. The variables' names aren't important, nor are the particular columns. It is important that each variable is in a different column, and that the columns are adjacent.

  • Each record is in a different row. Just by looking at the data, you can infer that row 3 represents a 52-year-old female who is a Democrat, row 11 represents a 34-year-old Republican male, and so on. No matter whether the data describe people, products, or plant life, in a list, each person, product, or plant is in a different row.

  • Variable names occupy the list's first row. In Figure 3.1, the variable names are Party, Sex, and Age, and they are in the first row of the list. They do not have to be in row 1 of the worksheet, but they must be in row 1 of the list.

NOTE

Excel's Help, and other Microsoft documentation, variously use the terms column labels and header row (among others) to represent the first row of a list. To avoid confusion with the letters at the top of each worksheet column (which Excel terms column headings), this book uses the term variable names to mean the values, normally text, in a list's first row.

Figure 3.2 shows two data ranges that are not lists. In the range A1:C22, the first row does not contain variable names in each column. In the range F1:I21, there is an empty column so that not all the columns are adjacent.

Figure 3.2Figure 3.2 Neither A1:C22 nor F1:I21 is a list.

However, just because these ranges violate a couple of rules for list making doesn't necessarily mean that you'll get an error message, or that Excel will quit unexpectedly. It just means that the tools you want to use with lists won't work as readily.

For example, suppose that you click in cell A2 of Figure 3.1; then you choose Filter from the Data menu and click AutoFilter. A dropdown will appear next to each variable name: Party, Sex, and Age.

But if you do the same with the data as shown in columns A:C of Figure 3.2, Excel ignores the first row and puts dropdowns in the second row, next to Democrat, Female, and Age. Excel puts the dropdowns in the first row in the range that has nonblank values, making the assumption that they are variable names. (You'll find much more information about Excel's data filters in this chapter's sections titled "Filtering Data with the AutoFilter" and "Using the Advanced Filter.")

But that behavior is not consistent. Suppose that you click in cell A2 as shown in Figure 3.2, and choose Sort from the Data menu. If you tell Excel that your sort range has a header row, it will sort the range A3:C22. If you specify no header row, it will sort starting one row higher: A2:C22. In neither case will it pick up the first row. This isn't the behavior you want. When you structure your worksheet, be sure to put the names of the variables in the same row.

You can force the sort to pick up the first row by selecting the entire range before choosing Sort from the Data menu, but you've still inconvenienced yourself. Excel will then let you sort on Party, Sex, and column C—and if you sort on column C, Excel sorts what it regards as the value "Age" to the bottom of the range.

TIP

Excel's ascending sort order puts numbers first, and then text values, and then logical values (TRUE comes before FALSE), and then error values such as #REF!, and finally blanks. Except blanks, the order is reversed for a descending sort. Regardless of the sort order, blanks always come last.

To further illustrate the point, in Figure 3.2, click in cell G5 and choose Data, Filter, AutoFilter. Excel puts the dropdowns in F1 and G1, but ignores I1. Column I is not regarded as part of the list because it's separated from the rest of the data by a blank column. You can select the entire range F1:I21 before you start the AutoFilter, and then you'll get dropdowns in cells F1:I1. But what's the point of doing that? Where possible, make the columns in your list adjacent.

Again, the poorly designed lists cause no error messages in these examples, but Excel does not behave as you'd want when it encounters list structures that it doesn't expect.

On the other hand, try selecting A1:C22 as shown in Figure 3.2, and choose PivotTable and PivotChart Report from the Data menu. In step 2 of the wizard, make sure that A1:C22 is in the Range box: Excel will try to avoid using a range that contains a blank variable name, and the way it resolves its difficulty depends on the version you're using.

At some point (again, the point at which this occurs depends on the version that you have installed), Excel complains that The PivotTable field name is not valid and you won't be able to complete the pivot table. All the columns in a list that you use for a pivot table have to have variable names. Another way to violate list structure appears in Figure 3.3.

Figure 3.3Figure 3.3 This arrangement transposes the list from records in rows to records in columns.

Suppose that you began by selecting the entire range seen in Figure 3.3. Now, if you try to use AutoFilter on the range as shown, Excel will put dropdowns in each cell in the first row. The assumption will be that you have a variable named Party, one named Democrat, another named Democrat, another named Republican, and so on.

In other words, although you won't cause an error message using AutoFilter with this layout, you won't get what you're after, either.

Your life with lists will be much easier if you put variable names in the first row, different records in different rows, and different variables in different, adjacent columns.

Setting Up Lists in Excel 2003

The title of this section is a little misleading. You set up lists in Excel 2003 exactly as you do in earlier versions. The difference is that after you've arranged your list, you can click any cell in the list, and then choose List from the Data menu and Create List from the cascading menu. The window shown in Figure 3.4 appears.

Figure 3.4Figure 3.4 Excel automatically proposes all adjacent, nonblank columns and rows for your list.

If Excel finds values in the first row that it can interpret as headers, it fills the My List Has Headers check box for you. Use the window to edit the list's range address if necessary, and use the check box to describe the list accurately. Then click OK. When you do so, several things happen:

  • A border is drawn around the list, including its header row.

  • The AutoFilter is turned on; you can tell this from the drop-down arrows in the header cells. (See this chapter's section titled "Filtering Data with the AutoFilter" for more information.)

  • A row for entering additional records is established at the bottom of the list. Excel terms this the insert row. You can identify it from the asterisk in the list's first column. (If you're familiar with Microsoft Access, you'll recognize the asterisk as the indicator for adding records.)

  • If you did not provide variable names, Excel supplies them for you, using the labels Column1, Column2, and so on.

  • With a list active, right-click in it, choose List from the shortcut menu, and click Total Row in the cascading menu. Excel adds a row to the list that can show eight different types of total, including Sum, Average, and Count. Click a cell in the Total row to choose the total you want from a drop-down list.

See Figure 3.5 for an example of how a list appears after you've used the Create List command.

Figure 3.2Figure 3.5 When you add a new value in any column in row 22, Excel expands the border and moves the insert row.

You can expand the list directly by clicking and dragging the resize handle in the bottom-right corner of the list.

Excel 2003 also provides automatic subtotals for your list. To get them, select any cell in the list, choose Data, List, and then click Total Row in the cascading menu. It's a toggle, so to remove the total row, just click Total Row again. (You can also get to the List menu by right-clicking any cell in the list.)

Using Data Forms

After you have a list set up, you can immediately start browsing through records, adding records, deleting records, and editing fields. You can use a form that Excel constructs for you automatically (see Figure 3.6).

All you need to get the Data Form to appear is to have a list, select any cell in the list, and choose Data, Form. A form that looks like the one shown in Figure 3.6 appears, and using it you can take any of the following actions:

  • Click New to establish a new record in the list.

  • See which record you're currently viewing by glancing at the record counter just above the New button.

  • Figure 3.6Figure 3.6 The Data Form is automatically tailored to your list's variable names and number of records.

  • Click Delete to delete the selected record. You're prompted to confirm that you want to delete it, and you can cancel the deletion if you want.

  • Change a value in one or more of the edit boxes. After you've done so, click Restore to return all variables in the current record to their prior values. After you move to another record, you can no longer use Restore on the edited record.

  • Move from edit box to edit box by using hot keys. Notice in Figure 3.6 that the edit box labels have hot keys on the form, indicated by the underscores. To move from, say, Party to Age, hold down Alt and simultaneously press Age's hot key, g.

  • Click Criteria to set a selection criterion on any of the variables in your list (see Figure 3.7).

  • Figure 3.7Figure 3.7 Clicking the Clear button clears all the boxes.

  • Enter a value in one or more boxes to establish selection criteria.

  • With criteria established, Find Prev takes you to an earlier record that matches the criteria and Find Next takes you to a subsequent matching record. If no match is found, the currently selected record remains selected.

  • Return to Form view by clicking Form.

  • Scroll through records by using the scrollbar.

  • Click Close to remove the Data Form.

The Data Form is a handy way to manage records and variables that are set out in list format. Using it requires only a list structure and knowing to choose Data, Form (and it's an easy way to impress someone who doesn't know it's there).

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020