How to Remove Dashes in Excel? (6 Easy Methods)

Sharing is caring!

Dashes are very common in Excel data. They appear in phone numbers, social security numbers, product codes, zip codes, and more. But sometimes, those dashes create problems when you are trying to sort data, run formulas, or prepare information for imports. The good news is that Excel gives several ways to remove dashes, depending on the type of data and your goal.

In this guide, we will explain how you can remove dashes using Find and Replace, SUBSTITUTE function, Flash Fill, Text to Columns, and Power Query.

Method 1: Remove Dashes Using Find and Replace

This is one of the quickest ways to remove hyphens inside cells.

Steps

  1. Select your data range
  2. Press Ctrl + H to open Find and Replace
  3. In Find what, type:
  4. Leave Replace with empty
  5. Click Replace All

Excel will instantly remove all dashes inside the selected cells.

This method works well when you want to remove all dashes permanently with no formulas involved.

Method 2: Remove Dashes Using the SUBSTITUTE Function

If you want a formula-based method, the SUBSTITUTE function is great because it keeps your original data unchanged.

Formula

=SUBSTITUTE(A2, "-", "")

Where:

  • A2 = cell with dashes
  • “-“ = find the dash
  • “” = replace dash with nothing

Steps

  1. Enter the formula in a blank column
  2. Copy down to apply to other rows
  3. Convert results to values if needed:
    • Copy → Right-click → Paste Values

With this method, the updated values are still linked to the original text unless converted to static values.

Method 3: Remove Dashes Using Flash Fill

Flash Fill recognizes patterns in data and fills in the rest automatically. This works best for data like phone numbers and IDs.

Steps

  1. In a new column, manually type a version of the first value without dashes
    • Example: if A2 is 555-222-9999, type 5552229999 in B2
  2. Go to Data tab
  3. Click Flash Fill or press Ctrl + E
  4. Excel will fill the column by following the pattern

If Flash Fill does not activate automatically, ensure that it is enabled:

  • File → Options → Advanced → Enable Flash Fill

Flash Fill is fast, but if data format is inconsistent, results may vary.

Method 4: Remove Dashes Using Text to Columns

This method is useful when Excel considers the numbers as text and you want to convert them into actual numbers.

Steps

  1. Select the column with dashes
  2. Go to Data tab → Text to Columns
  3. Choose Delimited → click Next
  4. Deselect all delimiters → click Next
  5. Select General as data format
  6. Click Finish

Excel will refresh the data format and remove unnecessary formatting issues, especially before using formulas.

Method 5: Remove Dashes with Power Query (for large datasets)

If you work with big datasets, Power Query provides a solid transformation approach.

Steps

  1. Select data → go to Data tab
  2. Click From Table/Range
  3. In Power Query editor, select the column
  4. Go to Transform tab → Replace Values
  5. Replace - with empty space
  6. Click Close & Load

Power Query is recommended when importing and cleaning thousands of records regularly.

Method 6: Remove Dashes Using Excel VBA (Automation)

If you need this task repeated often, a simple VBA script can help.

VBA Code Example

Sub RemoveDashes()
    Selection.Replace What:="-", Replacement:="", LookAt:=xlPart
End Sub

How to use

  1. Press Alt + F11
  2. Insert → Module
  3. Copy/paste the code
  4. Select your data and run the macro

This will remove dashes from the selected range in one click.

Convert Text to Numbers After Removing Dashes

Sometimes removing dashes still leaves values stored as text. To convert them to numbers:

Option A: Multiply by 1

=A2*1

Option B: VALUE Function

=VALUE(A2)

Option C: Error Checking

If you see a small green triangle:

  1. Click the warning icon
  2. Select Convert to Number

This ensures Excel recognizes them as numeric values for calculations or sorting.

Which Method Should You Use? (Quick Comparison)

MethodBest ForSkill LevelKeeps Original Data?
Find & ReplaceQuick edits on all cellsBeginnerNo
SUBSTITUTE functionClean data with formulasBeginner-IntermediateYes
Flash FillSimple patternsBeginnerYes
Text to ColumnsFixing text-formatted numbersIntermediateNo
Power QueryLarge, repetitive datasetsIntermediate-AdvancedYes
VBA MacroAutomated data cleaningAdvancedYes

If you work with sensitive IDs like SSNs, keeping original values intact using formulas is safer.

Tips to Maintain Clean Data in Excel

  • Use Data Validation to prevent unwanted characters
  • Convert imported values to proper formats early
  • Use Power Query for regular files from external sources
  • Always back up data before bulk cleaning

Common Use Cases

You might want to remove dashes in:

Type of DataExamples
Phone numbers555-444-1234 → 5554441234
SSN / Tax IDs123-45-6789 → 123456789
Postal codes123-45 → 12345
Product codesABC-123-XYZ → ABC123XYZ
Part numbers22-556-9 → 225569

Cleaning formatting improves consistency and prevents reporting errors.

Final Thoughts

Removing dashes in Excel is something everyone encounters when working with large spreadsheets, imported files, or business data. Whether you prefer keyboard shortcuts, formulas, or automation, Excel gives many tools to clean data quickly.

For a fast fix, use Find and Replace. If you want a clean and controlled approach, choose the SUBSTITUTE function. Working with thousands of rows? Go with Power Query.

Frequently Asked Questions

How do I quickly remove all dashes in Excel?

The fastest way is to use Find and Replace. Select your cells, press Ctrl + H, type in the “Find what” box, leave “Replace with” empty, then click Replace All.

How can I remove dashes using a formula in Excel?

You can use the SUBSTITUTE function. For example, =SUBSTITUTE(A2,"-","") removes all dashes from the value in cell A2 and returns a cleaned version.

Why are my numbers still treated as text after removing dashes?

Even after removing dashes, values may stay as text if they were imported or formatted that way. Use VALUE, multiply by 1 (for example, =A2*1), or use Text to Columns to convert them to real numbers.

Can I use Flash Fill to remove dashes from phone numbers?

Yes. Type the first phone number without dashes in a new column, then select the next cell and press Ctrl + E or use Data > Flash Fill. Excel will follow the pattern and remove dashes for the rest.

Will removing dashes affect leading zeros in my data?

Yes, it can. When you convert cleaned text to numbers, leading zeros may disappear. To keep them, format the column as Text first or use a custom number format instead of converting to numeric values.

What is the best method to remove dashes for large datasets?

For large or repeating tasks, tools like Power Query or a simple VBA macro work well. They let you clean and refresh data automatically instead of manually repeating the steps each time.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *