2 Easy Ways To Remove First Two Digits In Excel

Intro

Effortlessly remove the first two digits in Excel using two simple methods. Discover how to use formulas and formatting tricks to delete unwanted numbers from your data. Master Excels text manipulation functions and improve your data cleaning skills with these easy-to-follow steps.

Are you tired of dealing with large numbers in Excel and wanting to remove the first two digits? Whether you're working with dates, IDs, or codes, removing unnecessary characters can help you streamline your data and make it more manageable. In this article, we'll explore two easy ways to remove the first two digits in Excel, saving you time and effort.

Method 1: Using the RIGHT Function

Using the RIGHT Function in Excel

One of the simplest ways to remove the first two digits in Excel is by using the RIGHT function. This function extracts a specified number of characters from the right side of a text string. Here's how to use it:

  1. Select the cell where you want to display the result.
  2. Type =RIGHT(A1, LEN(A1)-2), assuming the original value is in cell A1.
  3. Press Enter to apply the formula.

The formula works as follows:

  • A1 is the cell containing the original value.
  • LEN(A1) returns the length of the text string in cell A1.
  • -2 subtracts 2 from the length, effectively removing the first two characters.
  • RIGHT extracts the remaining characters from the right side of the text string.

For example, if cell A1 contains the value "123456", the formula will return "3456".

Advantages of Using the RIGHT Function

  • Easy to use and understand.
  • Can be applied to a range of cells by copying the formula.
  • Works well with numbers and text strings.

Method 2: Using VBA Macro

Using VBA Macro to Remove First Two Digits in Excel

If you prefer a more automated solution, you can create a VBA macro to remove the first two digits in Excel. Here's how:

  1. Open the Visual Basic Editor by pressing Alt + F11 or navigating to Developer > Visual Basic.
  2. Insert a new module by clicking Insert > Module.
  3. Paste the following code:
Sub RemoveFirstTwoDigits()
    Dim cell As Range
    For Each cell In Selection
        cell.Value = Right(cell.Value, Len(cell.Value) - 2)
    Next cell
End Sub
  1. Save the module by clicking File > Save.
  2. Select the range of cells you want to apply the macro to.
  3. Press Alt + F8 to open the Macro dialog box.
  4. Select RemoveFirstTwoDigits and click Run.

The macro works as follows:

  • For Each cell In Selection loops through each cell in the selected range.
  • cell.Value = Right(cell.Value, Len(cell.Value) - 2) applies the same logic as the RIGHT function formula.

Advantages of Using VBA Macro

  • Can be applied to a large range of cells quickly.
  • Does not require manual entry of formulas.
  • Can be modified to perform more complex tasks.

Now that you've learned two easy ways to remove the first two digits in Excel, you can choose the method that best suits your needs. Whether you prefer the simplicity of the RIGHT function or the automation of a VBA macro, you'll be able to streamline your data and work more efficiently. Share your experiences and tips in the comments below!

Jonny Richards

Love Minecraft, my world is there. At VALPO, you can save as a template and then reuse that template wherever you want.