How to Remove Text from a Cell in Excel (9 Easy Ways)

In the following dataset, you can see the Product Name and Product ID columns. Let’s use it to demonstrate how you can remove text from the IDs.

Dataset to Remove Text from Excel Cell


Method 1 – Using Find and Replace Tool to Remove Text from a Cell in Excel

Steps:

  • Click Ctrl + H to open the Find and Replace dialog box.
  • Write ID in the Find what. Leave the Replace with box empty.
  • Press Replace All.

 Using Find and Replace Dialog Box to Replace Text from Excel Cell

  • Click OK in the notification box.

Popping up Dialog Box to Show the Number of Replacement

  • The text ID has been removed from all the cells (including the header).

The Result after Using Find and Replace Feature

Read More: How to Remove Text from an Excel Cell but Leave Numbers 


Method 2 – Use of SUBSTITUTE Function to Remove Text from a Cell

Steps:

  • Type the following formula in cell D5:

=SUBSTITUTE(C5,”ID”,””)

Using SUBSTITUTE Function to remove text from Excel cell

  • Press Enter.
  • Copy the formula to the other cells using the Fill Handle.

Applying the Fill Handle Tool

  • The Result column autofills:

The Outcome After Using SUBSTITUTE Function

Read More: How to Remove Letters from Cell in Excel 


Method 3 – Applying REPLACE Function to Remove Text from a Cell in Excel

Steps:

  • Write the formula in cell D5 as given below:

=REPLACE(C5,1,2,””)

Applying REPLACE Function to Remove Text from Excel Cell

  • Press Enter.
  • Drag down the formula with the Fill Handle tool.

Employing Fill Handle Tool

You can see the complete Result column.

Complete Result Column after using REPLACE Function

Read More: How to Remove Specific Text from Cell in Excel 


Method 4 – Combining MID and LEN Functions

The LEN function is a text function in excel that returns the length of a string/ text.

Steps:

  • Select cell D5.
  • Copy this formula:

=MID(C5,3,LEN(C5)-2)

Combining MID and LEN Functions to remove text from Excel Cell

Formula Breakdown

  • LEN(C5) → becomes
    • LEN(“ID1001”)
      • Output: 6
  • LEN(C5)-2 → becomes
    • LEN(6-2)
      • Output: 4
  • MID(C5,3,LEN(C5)-2) → becomes
    • MID(“ID1001”,3,4)
      • Output: 1001
  • Press Enter.
  • Drag down the formula with the Fill Handle tool.

Use of Fill Handle Feature

You can see the complete Result.

The output after using the MID and LEN Functions


Method 6 – Merging RIGHT and LEN Functions

Steps:

  • In cell D5, type the given formula:

=RIGHT(C5,LEN(C5)-2)

Merging RIGHT and LEN Functions to remove text from Excel Cell

Formula Breakdown

  • LEN(C5) → becomes
    • LEN(“ID1001”)
      • Output: 6
  • LEN(C5)-2 → becomes
    • LEN(6-2)
      • Output: 4
  • RIGHT(C5,LEN(C5)-2) → becomes
    • RIGHT(“ID1001”,4)
      • Output: 1001
  • Press Enter.
  • Drag down the formula with the Fill Handle tool.

Use of Fill Handle Feature

You can see the complete Result column.

Complete Result column after using the RIGHT and LEN Functions

Read More: How to Remove Text before a Space with Excel Formula 


Method 6 – Using LEFT and FIND Functions to Remove Text from a Cell in Excel

We have rearranged the dataset to include more characters. Let’s remove the characters before and including ‘#’ from every cell.

Steps:

  • Select cell D5 and write the formula given below:

=LEFT(C5,FIND(“#”,C5)-1)

Use of LEFT and FIND Functions to remove text from Excel Cell

Formula Breakdown

  • FIND(“#”, C5) → The FIND function will find the position of ‘#’ in cell C5.
    • Output: 5
  • LEFT(C5, FIND(“#”, C5)-1) → We have subtracted 1 because we want to remove the ‘#’ too. Then the LEFT function will keep the number of characters from the left side.
    • Output: 1001
  • Press Enter.
  • Drag down the formula with the Fill Handle tool.

Employing Fill Handle Tool

You can see the complete Result column.

 The Output after using the LEFT and FIND Function

Read More: How to Remove Text After Character in Excel 


Method 7 – Removing Nth Instance of Certain Character

We have rearranged my dataset to have two ‘#’ in every cell. We’ll remove the first ‘#’.

Steps:

  • Select cell D5 and type the formula given below:

=SUBSTITUTE(C5,”#”,””,1)

Using SUBSTITUTE Function for nth Instance

  • Hit Enter.
Note: If you want to remove the second ‘#’ then just type 2 instead of 1 in the formula.
  • Copy the formula for the other cells with the AutoFill feature.

Applying Fill Handle Feature

You can see the complete Result column.

Complete Result Column after Removing Text from nth Instance.


Method 8 – Applying Flash Fill Feature

Steps:

  • Type the digits you want to keep in cell D5.
  • When you start typing in the next cell, Excel will catch the pattern and show it.

Applying Flash Fill to Remove Text from Excel Cell

  • Press Enter and all cells will be filled with that pattern.

The result after Applying Flash Fill

Read More: How to Remove Text between Two Characters in Excel 


Method 9 – Using VBA Code to Remove Text from a Cell

Steps

  • Select the cell range to apply VBA. We selected cells D5:D9.
  • Right-click on the title name of the sheet.
  • Select View Code from the context menu.

Selecting View Code from Context Menu

  • A VBA window will open up.
  • Copy the code given below:
Sub Delete_Last_Char()
n = Int(InputBox("Type Number of Last Characters tobe Removed: "))
For i = 1 To Selection.Rows.Count
   Selection.Cells(i, 1) = Left(Selection. Cells(i, 1), _
   Len(Selection. Cells(i, 1)) - n)
Next i
End Sub

VBA Code

  • Click the Run button to run the code.
  • An input window will appear. Type the number of characters that you want to remove. We typed 3.
  • Press OK.

 Typing Number in the Input Window

Therefore, the last 3 characters in the Result column are removed.

Complete Result column using VBA

Read More: How to Remove Specific Text from a Column in Excel 


Practice Section

You can download the above Excel file and practice the explained methods.

Practice Section of the explained methods


Related Article

Get FREE Advanced Excel Exercises with Solutions!
Md. Sourov Hossain Mithun
Md. Sourov Hossain Mithun

Md. Sourov Hossain Mithun, an Excel and VBA Content Developer at Softeko's ExcelDemy project, joined in October 2021. Holding a Naval Architecture & Marine Engineering degree from BUET, Mithun showcases expertise during his two-year tenure. With over 200 published articles on Excel topics, he earned a promotion to Team Leader, excelling in leading diverse teams. Mithun's passion extends to Advanced Excel, Excel VBA, Data Analysis, and Python programming, contributing significantly to the innovative and dynamic environment of ExcelDemy... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo