Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

XL2000: Data Sort Selects an Incorrect Range


View products that this article applies to.

This article was previously published under Q214051

↑ Back to the top


Symptoms

In Microsoft Excel, when you select a single cell in a list, and then click Sort on the Data menu, an incorrect range of data may be selected.

↑ Back to the top


Cause

This problem can occur when the data in the second row of the first column in the list is typed entirely in capital letters and the data in the third row of the first column in the list is not typed entirely in capital letters.

When you sort data by selecting a single cell in a list and then clicking Sort on the Data menu, Microsoft Excel detects the column labels in the list, excludes them from the data that is sorted, selects the data to be sorted, and then displays the Sort dialog box.

If the data in the second row of the first column in the list is typed entirely in capital letters and the data in the third row of the first column in the list is not typed entirely in capital letters, Excel treats the first two rows as column labels and does sort these rows.

For example, if you select a single cell in the following list
A1: peach
A2: APPLE
A3: orange
A4: banana


and you then click Sort on the Data menu, the items orange and banana are selected as the data to be sorted. Microsoft Excel treats the items peach and APPLE as column labels and excludes them.

↑ Back to the top


Workaround

To work around this behavior, follow these steps:
  1. Select the whole list, including any column labels.
  2. On the Data menu, click Sort.
  3. In the Sort dialog box, under My list has, click Header row.

↑ Back to the top


More information

Users may experience similar results whenever Microsoft Excel cannot clearly determine the range of data and header information. For example, data with multiple header rows.

↑ Back to the top


References

For more information about sorting, click Microsoft Excel Help on the Help menu, type sort a list in the Office Assistant or the Answer Wizard, and then click Search to view the topic.

↑ Back to the top


Keywords: KB214051, kbprb

↑ Back to the top

Article Info
Article ID : 214051
Revision : 5
Created on : 11/5/2003
Published on : 11/5/2003
Exists online : False
Views : 276