Sorting Numbers with Commas

Last reviewed: November 17, 1997
Article ID: Q61465
The information in this article applies to:
  • Microsoft Word for the Macintosh, versions 4.0, 5.0, 5.1

SUMMARY

Microsoft Word sorts numbers with commas (for example, 1,000 or 2,345,234) in standard numeric order (for example, 45; 367; 1,234; 34,123...) if the numbers are the only characters in the paragraph. If, however, there is any other text in the paragraph (this includes a space or tab), the comma is considered to be text and Word will sort the numbers before the comma first (for example 12,234; 34; 456,289; 798 -- that is, 1<3<4<7).

MORE INFORMATION

Word ignores commas in a number if the number is the only group of characters in the paragraph. However, if other text is added to the paragraph, Word interprets the entire paragraph as a text string. Commas are then seen as part of the text string and become delimiters between distinct values rather than delimiters between numeric placeholders. Text sorting sorts numbers first, then it sorts alphanumeric characters. Thus, "12,345a" (without quotation marks) will be sorted before "234a" (without quotation marks).

This problem also occurs if the numbers that contain commas are in a table that was created using Word's Insert Table command.

The only workaround is to not use commas in numbers. Then, "12345a" (without quotation marks) will sort after "234a" (without quotation marks).

NOTE: You can use the commas if you hold down the OPTION key and select just the numeric values in each paragraph. This is only possible, however, if the numbers in each paragraph are perfectly aligned with each other so that no nonnumeric characters are highlighted.


Additional query words: macword macword5
Version : 4.0, 5.0, 5.10
Platform : MACINTOSH
Issue type : kbprb


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: November 17, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.