KutoolsforOffice — One Suite. Five Tools. Get More Done.

Remove Duplicate Characters or Words in Excel

AuthorXiaoyangLast modified

When working with text data in Excel, it is common to encounter duplicate characters or repeated words within a single cell. This often happens with imported data, user input, tags, or product descriptions. Cleaning these duplicates can improve readability, ensure data consistency, and make further analysis more reliable.

In this guide, we will walk you through several effective methods to remove duplicate characters or words in Excel. These include built-in formulas, a faster batch solution using Kutools for Excel, and customizable VBA functions. You can choose the most suitable method based on your Excel version, technical level, and workflow needs.

all duplicate characters are removed

Remove duplicate characters in Excel

Removing duplicate characters means keeping only the first occurrence of each character within a cell (for example, converting "aabbcc" → "abc"). Below are three practical methods to achieve this.

Using Excel formula

If you are using Excel for Microsoft 365 or Excel 2021 and later, you can remove duplicate characters using dynamic array formulas. This method is fully built-in and automatically updates when your source data changes, making it ideal for users who prefer formula-based solutions.

Steps:

  1. Select a blank cell where you want to display the result (for example, D2).
  2. Enter the following formula:
    =TEXTJOIN("",,UNIQUE(MID(A2,ROW(INDIRECT("1:"&LEN(A2))),1)))
  3. Press Enter to get the result.
  4. Drag the fill handle down to apply the formula to other cells if needed.
    how to use the formula

How the formula works:

  • MID extracts each character from the text
  • ROW + INDIRECT generates character positions
  • UNIQUE removes duplicates
  • TEXTJOIN combines the result back into a string
Notes:
  • This method only works in Excel 365 / 2021 or later
  • If you see #NAME?, your version may not support these functions

Using Kutools for Excel in bulk

If you want to avoid complex formulas and need a faster, more user-friendly approach—especially for large datasets—Kutools for Excel provides a convenient way to remove duplicate characters in bulk.

Kutools for Excel - Packed with over 300 essential tools for Excel. Make Excel tasks faster, easier, and more efficient. Download now!

Steps:

  1. Select the range of cells where you want to remove duplicate characters.
  2. Go to Kutools > Text > Remove Characters.
    enable the remove characters feature
  3. In the Remove Characters dialog box, only check the Duplicated characters option. Click OK.
    configure the remove characters dialog

Result:

All duplicate characters in each selected cell are removed instantly, keeping only the first occurrence.

all duplicate characters are removed

Advantages:

  • No formulas or coding required
  • Works in all Excel versions
  • Supports batch processing
  • Simple and intuitive interface
  • Saves significant time for large datasets

Kutools for Excel - Supercharge Excel with over 300 essential tools, making your work faster and easier, and take advantage of AI features for smarter data processing and productivity. Get It Now


Using user-defined function

If your Excel version does not support dynamic array formulas, or if you prefer a reusable custom solution, you can use a VBA user-defined function (UDF) to remove duplicate characters.

Steps:

  1. Press Alt + F11 to open the VBA editor.
  2. Click Insert > Module.
  3. Paste the following code:
    VBA code: Remove duplicate characters
    Function RemoveDupes1(pWorkRng As Range) As String
    'Updateby Extendoffice
    Dim xValue As String
    Dim xChar As String
    Dim xOutValue As String
    Set xDic = CreateObject("Scripting.Dictionary")
    xValue = pWorkRng.Value
    For i = 1 To VBA.Len(xValue)
        xChar = VBA.Mid(xValue, i, 1)
        If xDic.Exists(xChar) Then
        Else
            xDic(xChar) = ""
            xOutValue = xOutValue & xChar
        End If
    Next
    RemoveDupes1 = xOutValue
    End Function
    use the VBA code in module
  4. Press Alt + Q to close the VBA editor and return to Excel.
  5. In a blank cell where you want to display the result, enter the following formula:
    =RemoveDupes1(C2)
    apply the related formula
Notes:
  • Macros must be enabled
  • The function only works in the current workbook

Additional: Remove duplicate words with user defined function

In some cases, your data may contain repeated words instead of characters, such as:

marketing,sales,marketing,crm

You may want to keep only unique words while preserving their order.

This method allows you to remove duplicate words based on a delimiter such as comma, space, or semicolon.

Steps:

  1. Press Alt + F11 to open the VBA editor.
  2. Click Insert > Module.
  3. Paste the following code:
    VBA code: Remove duplicate words
    Function RemoveDupes2(txt As String, Optional delim As String = " ") As String
        Dim x
        With CreateObject("Scripting.Dictionary")
            .CompareMode = vbTextCompare
            For Each x In Split(txt, delim)
                If Trim(x) <> "" And Not .exists(Trim(x)) Then .Add Trim(x), Nothing
            Next
            If .Count > 0 Then RemoveDupes2 = Join(.keys, delim)
        End With
    End Function
    
    use the VBA code 2 in module
  4. Press Alt + Q to close the VBA editor and return to Excel.
  5. In a blank cell where you want to display the result, enter the following formula:
    =RemoveDupes2(A2,",")
  6. Press Enter to get the result, then drag the Fill Handle down to apply the formula to other cells.
    apply the related formula of code 2
Notes:
  • In this formula, you can replace "," with other delimiters like " " or ";"
  • Works best when data is consistently formatted
  • Multiple delimiters may require customization

Conclusion

Removing duplicate characters or words in Excel can be achieved in several ways, depending on your needs and Excel environment.

  • Use Excel formulas if you prefer a built-in and dynamic solution (Excel 365/2021).
  • Use Kutools for Excel if you want a fast method for batch processing without formulas.
  • Use VBA functions if you need flexibility or are working with older Excel versions.

Each method has its own advantages, and the best choice depends on your workflow, technical comfort, and data complexity. For most users handling large datasets, a tool like Kutools can significantly simplify the process and improve efficiency.


Best Office Productivity Tools

🤖Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions
Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |  Round without Formula ...
Super Lookup: Multiple Criteria VLookup    Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |  Big Formula Bar    Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells    Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more
Use Kutools in your preferred language – supports English, Spanish, German, French, Chinese, and 40+ others!

Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time.  Click Here to Get The Feature You Need The Most...


Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!

All Kutools add-ins. One installer

Kutools for Office suite bundles add-ins for Excel, Word, Outlook & PowerPoint plus Office Tab Pro, which is ideal for teams working across Office apps.

ExcelWordOutlookTabsPowerPoint
  • All-in-one suite — Excel, Word, Outlook & PowerPoint add-ins + Office Tab Pro
  • One installer, one license — set up in minutes (MSI-ready)
  • Works better together — streamlined productivity across Office apps
  • 30-day full-featured trial — no registration, no credit card
  • Best value — save vs buying individual add-in