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
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.
Discover the Power of Microsoft Office This beginner-friendly guide reveals the expert tips and strategies you need to skyrocket your productivity and use Office 365 like a pro. Mastering software like Word, Excel, and PowerPoint is essential to be more efficient and advance your career. Simple lessons guide you through every step, providing the knowledge you need to get started. Check out Microsoft Office 365 For Beginners today!
Macros are created for all sorts of purposes in creating, editing, and processing documents. You might want to use a ...
Discover MoreCan you really use Find and Replace to change the case of text in your document? Not really, but that shouldn't stop you ...
Discover MoreWhen using Find and Replace, how your replacements are formatted will depend on how the text being replaced is formatted. ...
Discover MoreFREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
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,
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.
Visit the WordTips channel on YouTube
FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2025 Sharon Parq Associates, Inc.
Comments