Excel VBA Course
Excel VBA Course - From Beginner to Expert

200+ Video Lessons
50+ Hours of Video
200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

View Course

delition of 1st 2 letters/numbers & last 2 letters/numbers in coloumn

0

 In a coloumn I want to delete 1st and last 2 letters or numbers in coloumn. (Ex:  AD45687SA OR 225867465). In first example i want to delete 1st two letters AD and last 2 letters SA. In second Ex example I want to delete 1st 2 numbers 22 and last 2 numbers 65. Can any one please help me how to construct the formula.

Answer
Discuss

Answers

0
Selected Answer

Method 1.  if your data is in column A1, then copy this formula: 

=MID(A1,3,5) 
to Column D1.  It takes the middle of your number(s) starting with the 3rd character to the 7th character.

Method 2. use Text to column (Under Data / Text to Column) Fixed Width on the next tab, create a Column Break after the 2nd character & another before the last characters. Next on format box - choose 'do not import(skip) the 2 columns you do not want.  This will give you the middle of the data that you want. [ Note: I do this in a different column, because it will overwrite your original data]

Discuss


Answer the Question

You must create an account to use the forum. Create an Account or Login