Log in  \/ 
x
or
x
x
Register  \/ 
x

or

Add dashes to SSN in a cell

This tutorial explains how to add dashes to a social security number in a cell with a formula. Besides, you will learn how to remove dashes from SSN in Excel as well.

Add dashes to SSN
Remove dashes from SSN


Add dashes to SSN

As the below screenshot, there is a column of social security numbers need to be added dashes. You can apply the below formula to get it down.

Generic formula

=LEFT(A1,3)&"-"&MID(A1,4,2)&"-"&RIGHT(A1,4)

Arguments

A1: Represents the cell containing the SSN in which you will add dashes.

How to use this formula?

1. Select a blank cell to output the result. In this case, I select D3.

2. Enter the below formula into it and press the Enter key. And then drag its Fill Handle all the way down to apply the formula to other cells.

=LEFT(B3,3)&"-"&MID(B3,4,2)&"-"&RIGHT(B3,4)

Notes:

  • In the formula, B3 is the cell containing the SSN in which you want to add dashes. You can change it as you need;
  • As the social security numbers are made by 9 digits and displayed as AAA-GG-SSSS commonly, the below easy formula can also help. See the below formula.
    =TEXT(TRIM(B3), "000-00-0000")

How this formula works?

=LEFT(B3,3)&"-"&MID(B3,4,2)&"-"&RIGHT(B3,4)

1. LEFT(B3,3): The LEFT function extracts 3 characters from the right side of "253090001" and returns the result as 253.

2. MID(B3,4,2): The MID function extracts 2 characters starting with the fourth character of "253090001". Here the result is 09.

3. RIGHT(B3,4): The RIGHT function extracts 4 characters from the left side of "253090001" and returns the result as 0001.

4. "253"&"-"&"09"&"-"&"0001": Finally we use the & operator to combine "253", "09" and "0001" with character "-". The result is "253-09-0001".


Remove dashes from SSN

It is easy to remove dashes from the social security numbers with the SUBSTITUTE function.

Generic formula

=SUBSTITUTE(A1,"-","")

Arguments

A1: Represent the cell containing the SSN you want to remove dashes from.

How to use this formula?

1. Select a blank cell.

2. Enter the below formula into it and press the Enter key to get the result. Select the result cell again, and then drag its Fill Handle down to apply the formula to other cells.

=SUBSTITUTE(B3,"-","")

How this formula works?

=SUBSTITUTE(B3,"-","")

The SUBSTITUTE function replaces all dashes in "253-09-0001" with nothing, and returns the result as "253090001".


Related functions

Excel LEFT function
The LEFT function extracts the given number of characters from the left side of a supplied string.

Excel MID function
The MID function is used to find and return a specific number of characters from the middle of given text string.

Excel RIGHT function
The Excel RIGHT function extracts a specific number of characters from the right side of the text string.

Excel SUBSTITUTE function
The Excel SUBSTITUTE function replaces text or characters within a text string with another text or characters.


Related formulas

Remove Extension From File Name
This tutorial provides a formula in detailed steps to help you remove extension from a file name in Excel.

Remove First N Characters From Cell
This tutorial introduces two formulas to help you easily remove the first n characters from a cell in Excel.

Remove Line Breaks From Cells In Excel
This tutorial provides three formulas to help you removing line breaks (which are occurred by pressing Alt + Enter keys in a cell) from specific cells in Excel.

Remove Text From Cell By Matching The Content
This article shows you how to use the SUBSTITUTE function to remove part of text string from specified cells by matching content.

Remove Text From A Cell Based On Specific Position
This tutorial explains how to use formulas to remove text from a cell based on specific position in Excel.


The Best Office Productivity Tools

Kutools for Excel - Helps You To Stand Out From Crowd

Would you like to complete your daily work quickly and perfectly? Kutools for Excel brings 300 powerful advanced features (Combine workbooks, sum by color, split cell contents, convert date, and so on...) and save 80% time for you.

  • Designed for 1500 work scenarios, helps you solve 80% Excel problems.
  • Reduce thousands of keyboard and mouse clicks every day, relieve your tired eyes and hands.
  • Become an Excel expert in 3 minutes. No longer need to remember any painful formulas and VBA codes.
  • 30-day unlimited free trial. 60-day money back guarantee. Free upgrade and support for 2 years.
Ribbon of Excel (with Kutools for Excel installed)

Office Tab - Enable Tabbed Reading and Editing in Microsoft Office (include Excel)

  • One second to switch between dozens of open documents!
  • Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
  • Increases your productivity by 50% when viewing and editing multiple documents.
  • Brings Efficient Tabs to Office (include Excel), Just Like Chrome, Firefox, And New Internet Explorer.
Screen Shot of Excel (with Office Tab installed)
Say something here...
symbols left.
You are guest
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.

Be the first to comment.