Using an En Dash, by Default

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


7

The style guide Phil follows stipulates that when indicating ranges of numbers (such as 1—9 or 23—36), an en dash should be used rather than a hyphen. Phil wonders if there is a way to force Word to do this automatically.

There are a couple of ways you can put the en dash between your number ranges. The "automatic" way (as far as Word is concerned) is to surround your hyphen by spaces. In other words, let's say that your range is something like 23—45. All you need to do is type 23, space, hyphen, space, and then 45. The moment you type a space or a punctuation mark after "45," the hyphen is transformed, automatically, into an en dash.

Using this approach, while handy, leaves the spaces before and after the en dash, which may run afoul of your style guide. If it does, you can always use Find and Replace to get rid of any spaces before and after en dashes. Or, you could simply bypass the automatic method and learn to type your own en dashes. The easiest way is to simply press Ctrl and press the minus key on the numeric keypad. (It has to be on the numeric keypad.) Word inserts the en dash lickety-split.

You can also use Word's Find and Replace tool to change all hyphens to en dashes. Here's how:

  1. Press Ctrl+H. Word displays the Replace tab of the Find and Replace dialog box.
  2. Click the More button, if it is available. (See Figure 1.)
  3. Figure 1. The Replace tab of the Find and Replace dialog box.

  4. Make sure the Use Wildcards check box is selected.
  5. Enter the following in the Find What box: ([0—9])-([0—9])
  6. Enter the following in the Replace With box: \1^=\2
  7. Click Replace All.

These steps replace any digit followed by a hyphen and then another digit with the original digit followed by an en dash followed by the original digit. Unfortunately, it won't perform the replacement if the hyphen is preceded or followed by a space. If your text includes such errant spaces, you'll need to get rid of them before the above will work properly.

Or, you can use a macro that will do all the permutations of Find and Replace for you. The following macro actually invokes Find and Replace seven times, with the result being that any range that contains any permutation of hyphen or en dash surrounded by single spaces will be converted to digits surrounding a single en dash.

Sub FixNumberRanges()
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = "([0-9])-([0-9])"
        .Replacement.Text = "\1^=\2"
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = True
        .MatchSoundsLike = False
        .MatchAllWordForms = False

        .Execute Replace:=wdReplaceAll

        .Text = "([0-9]) -([0-9])"
        .Execute Replace:=wdReplaceAll

        .Text = "([0-9])- ([0-9])"
        .Execute Replace:=wdReplaceAll

        .Text = "([0-9]) - ([0-9])"
        .Execute Replace:=wdReplaceAll

        .Text = "([0-9]) ^=([0-9])"
        .Execute Replace:=wdReplaceAll

        .Text = "([0-9])^= ([0-9])"
        .Execute Replace:=wdReplaceAll

        .Text = "([0-9]) ^= ([0-9])"
        .Execute Replace:=wdReplaceAll
    End With
End Sub

Note that when you run the macro, all changes are made without pause. Be aware that there may be some hyphens you don't want replaced, such as those within URLs or those that are part of math formulas. If your documents have exceptions to what you need replaced, then you'll either need to change the macro to account for those exceptions, or just go with the manual Find and Replace which allows you to step through each potential change and determine if it should be made.

Note:

If you would like to know how to use the macros described on this page (or on any other page on the WordTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

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

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

Moving Between and Selecting Sheets with the Keyboard

Hate to take your fingers off the keyboard? Here's how you can move from worksheet to worksheet without touching the mouse.

Discover More

Three-Dimensional Transpositions

Excel makes it easy to transpose your data so that rows become columns and columns rows. It doesn't have a built-in ...

Discover More

Counting Ports of Call with a PivotTable

A PivotTable is a great way to aggregate and analyze data. Sometimes, though, it can be difficult to figure out how to ...

Discover More

Do More in Less Time! Are you ready to harness the full power of Word 2013 to create professional documents? In this comprehensive guide you'll learn the skills and techniques for efficiently building the documents you need for your professional and your personal life. Check out Word 2013 In Depth today!

More WordTips (ribbon)

Too Many Edits Prevent Pasting

Sometimes Word can be rather cryptic in the error messages it provides. One such cryptic message warns about "too many ...

Discover More

Permanently Turning Off the Tracking of Formatting Changes

The Track Changes tool can be a great asset when you are working on a document with others. It can also be a hassle if ...

Discover More

Inserting the Date and Time

Inserting a date and time in your document is a snap using the tools provided in Word. Just pick the command, then ...

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 5 - 3?

2024-04-17 04:00:15

Robert Love

@Paul: Yes, that en dash you typed on a line by itself is definitely an en dash in my browser. I still think there is something going on that needs explaining. In Allen's text it appears that en dash has been systematically replaced by em dash throughout. It would be nice if Allen could notice this conversation and offer a comment.


2024-04-16 09:13:38

Paul Stregevsky

"I see that Paul's comment too contains an em dash where he presumably typed an en dash. Is this website changing what people type in?!"

I'm a stickler for distinguishing my ens from my ems, so I don't know what went wrong. I used my custom keyboard shortcut Control-N to enter an en dash in Outlook; then I pasted it into the web form on this page. I haven't even created a similar shortcut (Control-M) for inserting an em dash. So I don't know what went wrong. Next time I'll copy and paste from a website. In fact, let's see how it renders when I copy and paste an actual rendered en dash from a page that provides the HTML code for that character only :

OK, that looks like an en, not an em, in my draft. Here goes...


2024-04-16 04:17:01

Robert Love

I see that Paul's comment too contains an em dash where he presumably typed an en dash. Is this website changing what people type in?!

Regarding auto-correct et al., my version of Word has an option in Autoformat-as-you-type that replaces two hyphens by an en-dash, and this seems to be enabled by default. Which presumably means that many users be default have two easy ways to type an en dash: either that, or the CTRL+minus shortcut I mentioned before. The two-hyphens convention should be fairly well known: I think quite a few other word processing and editing tools support it (Atlassian Confluence, for example). I've also worked on projects where an Auto-correct was created to convert three hyphens to an em dash.


2024-04-15 11:56:40

Paul Stregevsky

When I use an en dash, it's seldom to define a range of numbers. More often, it's to denote that two ideas are corollary.

For example, I'll write African—American relations when I mean relations between Africa and America. If instead I wrote African-American relations, many readers would wrongly think I mean relations between African Americans and White Americans.

Other times, I'll use an en dash to fuse a pair of phrases or multiword names:

A United States—United Arab Emirates Alliance. Yes, in this case, I could have written U.S/UAR, but I prefer to use the slash mark to connote contrast or difference ("Yes/No").


2024-04-15 10:28:21

Andrew

I "love" what Robert said (tee hee). How else do you distinguish between hyphens that should remain hyphens between digits (social security numbers, dates, phone numbers, etc.) and hyphens that should denote a range of numbers? These are semantic (and not just textual) differences, so I've just taught myself to type the code for the en-dash.

Andy.


2024-04-15 04:03:19

Robert Love

This tip muddies the waters somewhat by using an em dash instead of an en dash in the text.

None of this trouble would be necessary if you would simply type an en dash instead of a hyphen when creating your text. It's not as if that's hard to do. You can easily insert an en dash with CTRL+minus, where the minus is the one on the numeric keypad.


2024-04-13 09:32:28

Steven Wilhelm

I've used a different approach for years. I use AutoCorrect to insert an en dash when I type n- (that is, n hyphen). I use a similar approach to get an em dash, typing m- (that is, m hyphen).


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.