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

Creating Scenarios

Excel allows you to create different scenarios for the data in your worksheet. These can be saved and managed using the ...

Discover More

Controlling Automatic Backups

Excel can make backups whenever you save your workbook. If you want to turn the feature on or off, this tip explains how ...

Discover More

Importing Multiple Files to a Single Workbook

If you use Excel to work with data exported from another program, you might be interested in a way to import a large ...

Discover More

Comprehensive VBA Guide Visual Basic for Applications (VBA) is the language used for writing macros in all Office programs. This complete guide shows both professionals and novices how to master VBA in order to customize the entire Office suite for their needs. Check out Mastering VBA for Office 2010 today!

More WordTips (ribbon)

Creating Special, Compound Characters

If you have a need for special characters (particularly in technical documents), Word provides a couple of ways you can ...

Discover More

Understanding Hyphens and Dashes

Word provides you with three types of hyphens and two types of dashes that you can use in your documents. Understanding ...

Discover More

Inserting Foreign Characters

It is not unusual to need to insert foreign characters (often called diacritical marks) as part of your typing. Word ...

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 four less than 7?

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.