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
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:
- Select the cell where you want to display the result.
- Type
=RIGHT(A1, LEN(A1)-2)
, assuming the original value is in cell A1. - 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
If you prefer a more automated solution, you can create a VBA macro to remove the first two digits in Excel. Here's how:
- Open the Visual Basic Editor by pressing
Alt + F11
or navigating to Developer > Visual Basic. - Insert a new module by clicking
Insert
>Module
. - 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
- Save the module by clicking
File
>Save
. - Select the range of cells you want to apply the macro to.
- Press
Alt + F8
to open the Macro dialog box. - Select
RemoveFirstTwoDigits
and clickRun
.
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.
Remove First Two Digits in Excel Image Gallery
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!