Flagging Incorrect Commas in Numbers

Written by Allen Wyatt (last updated April 12, 2025)
This tip applies to Word 2007, 2010, 2013, 2016, 2019, 2021, 2024, and Word in Microsoft 365


1

In the reports that Michael prepares, he needs to separate numbers by thousands using commas. He wonders if there is a way to make Word "flag" numbers that have the comma in the wrong place, such as 100,00 or 20,0000.

There is no way to do this automatically within Word. While it might seem that this is something that might be "checkable" by grammar checking, it is not. (I suspect this has to do with the fact that how delimiters like commas are used in numbers can vary wildly based on regional settings in Word.)

One thing you could do is to use the Find and Replace feature in Word to look for incorrect placement of the comma. This can be done with a wild card search, which means that you need to press Ctrl+H and then display the Find tab of the resulting dialog box. Display the options and then make sure the Use Wildcards check box is selected. Here is what you should search for:

(,)([0-9]{1,2})([ .\!\?])

This search pattern looks for thousands groups that are too short, as in 100,00. It looks for a comma followed by either one or two digits and, finally, a space, period, exclamation mark, or question mark.

If you want to search for something that has too many zeroes (such as 20,0000), then you can use the following pattern:

([0-9]{4,})([, .\!\?])

This searches for four or more digits followed by a comma, space, period, exclamation mark, or question mark.

Obviously these two search patterns can be adjusted to better fit the nature of your documents, but they do provide a starting point. For instance, I used earlier in this tip an invalid number surrounded by parentheses (such as 20,0000). The second search pattern won't find this instance because it does look for instances where the number is followed by a closing paren. If you have such numbers in your document, you could adjust the pattern accordingly. Or, you could take a different approach and look for a comma followed by four or more digits:

(,)([0-9]{4,})

Again, the idea is to look at what you have in your document and then develop a search pattern that fits the nature of what you find.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (10145) applies to Microsoft Word 2007, 2010, 2013, 2016, 2019, 2021, 2024, and Word in Microsoft 365.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Changing Your Name

One of the many pieces of information that Excel keeps track of is your name. If you want to change your name for Excel's ...

Discover More

Disappearing Footnotes

Footnotes can be an integral part of many documents, particularly those written for a scholarly audience. If those ...

Discover More

Printing Individual Worksheets for Vendors

If you use a worksheet to track data for multiple vendors, you may wonder if there is a way to print individual ...

Discover More

The First and Last Word on Word! Bestselling For Dummies author Dan Gookin puts his usual fun and friendly candor back to work to show you how to navigate Word 2019. Spend more time working and less time trying to figure it all out! Check out Word 2019 For Dummies today!

More WordTips (ribbon)

Finding Missing Spaces before Numbers

If you want to insert a space between letters and digits in your document, you have a couple of tasks to perform. First, ...

Discover More

Replacing an X with a Check Mark

In order to provide a finishing touch to your document, you may want to replace mundane X marks with fancier check marks. ...

Discover More

Finding and Replacing Text Boxes

The Find and Replace capabilities of Word are very powerful, but they still come up a bit short when searching for some ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 7 + 1?

2025-04-14 11:26:59

Andrew

To “([, .\!\?])” there should probably have a colon, semicolon, and right parenthesis added to account for numbers at the ends of clauses (not just sentences). And there could also be added right square bracket, right curly bracket, right angle bracket, pound sign, percent sign, and hyphen to account for bracketed numbers, pounds, percentages, and ranges.

Another strategy to this problem is to use a “subtractive” approach by highlighting all words consisting of any string of digits, commas, and periods and serially removing the highlighting from any highlighted text consisting of
• a period (decimal point) followed by two (or, if not specifically looking for currency, any number of) digits at the end of a word;
• a comma followed by three digits; and
• 1, 2, or 3 digits at the beginning of a word,
and then examining all remaining highlighted text for the possibility of being part of improperly constructed numbers. Note, there may well be a lot of false positives given that this approach will highlight all or parts of index numbers, page numbers, section numbers, phone numbers, SSN’s, etc., including (or just merely) periods or commas following these kinds of numbers.

Andy,


This Site

Got a version of Word that uses the ribbon interface (Word 2007 or later)? This site is for you! If you use an earlier version of Word, visit our WordTips site focusing on the menu interface.

Videos
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.