XL: Data Sort Using Incorrect Guess Range

Last reviewed: February 2, 1998
Article ID: Q108484
The information in this article applies to:
  • Microsoft Excel 98 Macintosh Edition
  • Microsoft Excel 97 for Windows
  • Microsoft Excel for Windows 95, versions 7.0, 7.0a
  • Microsoft Excel for Windows, versions 5.0, 5.0c
  • Microsoft Excel for the Macintosh, versions 5.0, 5.0a

SYMPTOMS

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

CAUSE

This problem occurs 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 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. However, 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, Microsoft Excel treats the first two rows as column labels and does sort these rows.

Example

If you select a single cell in the following list

   A1: peach
   A2: APPLE
   A3: orange
   A4: banana

and 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.

WORKAROUND

To work around this behavior, select the entire list (including the column labels) before you click Sort on the Data menu, and select Has Header Row under "My list has" in the Sort dialog box.

REFERENCES

For more information about sorting a list from top to bottom, click the Search button in Help and type:

   sorting


Additional query words: 5.00 7.00 8.00 97 XL97 98 XL98
Keywords : xllist
Version : MACINTOSH:5.0,5.0a,98; WINDOWS:5.0,5.0c,7.0,7.0a,97
Platform : MACINTOSH WINDOWS
Issue type : kbprb
Solution Type : kbworkaround


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: February 2, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.