Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, and 2013. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Replacing Dashes with Periods.

Replacing Dashes with Periods

by Allen Wyatt
(last updated December 26, 2018)

6

If you have a need to normalize the appearance of your data, you might want to replace any dashes in a text string with periods. For instance, if you have a phone number such as "123-555-1212" you might want to change it to "123.555.1212". This is easy to do using the SUBSTITUTE function:

=SUBSTITUTE(A7,"-",".")

The result is that any dashes appearing in the string in cell A7 are replaced with periods.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (11028) applies to Microsoft Excel 2007, 2010, and 2013. You can find a version of this tip for the older menu interface of Excel here: Replacing Dashes with Periods.

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

Using AutoFiltering

Excel's AutoFilter tool is a great way to make a long list of items much more manageable. This tip explains how to set up ...

Discover More

Renaming a File

Need to rename a disk file from within a macro? You can do it using the Name command, described in this tip.

Discover More

Updating a Field in a Text Box

If you put a field into a text box, you might be surprised to find that it doesn't update when you try to update all your ...

Discover More

Program Successfully in Excel! John Walkenbach's name is synonymous with excellence in deciphering complex technical topics. With this comprehensive guide, "Mr. Spreadsheet" shows how to maximize your Excel experience using professional spreadsheet application development tips from his own personal bookshelf. Check out Excel 2013 Power Programming with VBA today!

More ExcelTips (ribbon)

Determining a Name for a Week Number

You could use Excel to collect data that is useful in your business. For instance, you might use it to collect ...

Discover More

Finding the First Non-Digit in a Text Value

If you have a string of text that is composed of digits and non-digits, you may want to know where the digits stop and ...

Discover More

Alphabetic Column Designation

Want to know the letters assigned by Excel to a particular column? Excel normally deals with column numbers, but you can ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, 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}] 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 eight more than 3?

2018-12-31 17:57:33

Neil

REPLACE would also work just fine for this. You can do REPLACE in a selection (like a column) if you don't want to do the replacement in the entire sheet.


2018-12-28 16:48:15

Yvan Loranger

Slightly off-topic but SUBSTITUTE has a 4th parameter:
SUBSTITUTE(string,oldtext,newtext,occurrence) where an occurrence of 3 would substitute only the 3rd occurrence.
If not specified [as in this Excel Tip] all occurrences are substituted.


2018-12-28 07:54:12

Harold Druss

How about a column of existing phone numbers.
How do I format the entire column.


2018-12-27 05:12:10

SteveJez

Henry,
The following will deal with the negative number issue as the substitute is only intended to be applied to a text string in this example

=IF(ISTEXT(A7),SUBSTITUTE(A7,"-","."),"Cell "&CELL("address",A7)&" is not text")

Steve


2018-12-26 10:13:26

Henry Noble

Be careful also with negative numbers, including those displayed with parentheses. E.g. (7,394.00).


2018-12-26 09:33:38

JD Murphy

Using the SUBSTITUTE function:
Be careful if you are worried about FORMAT.


This Site

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

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, 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.