Excel - split string

I want to get the last two char from a column in Excel file and move to the next column. What is the fomular?
Sample

column A

Boston  MA
Chicago IL


result

Column A   column B

Boston        MA
Chicago       IL
VBdotnet2005Asked:
Who is Participating?
 
TazDevil1674Connect With a Mentor Commented:
Presuming your data is in column A type following in column B & C

Column B
=LEFT(A2,LEN(A2)-3)

Column C
=RIGHT(A2,2)

This will give what you want
0
 
flaphead_comCommented:
-or- as VBA

Sub Split()
  Sheets("Sheet2").Select
  Cells(1, 1).Select
 
  Do Until IsEmpty(ActiveCell)
    ACV = ActiveCell.Value
    NextCol = Split(ACV, " ")
    ActiveCell.Offset(0, 1).Value = NextCol(1)
    ActiveCell.Offset(1, 0).Select
  Loop
   
End Sub
0
 
xtermieCommented:
You can easily parse text with inherent Excel functionality.  
If the two letters are always at the end of the column, you can use the built in functionality of Excel, text to columns.  This is under the Data tab.
Select Delimited and Check that the data is split by a space.
Hassle free!

Here are some detailed info
http://excelhints.com/2010/01/29/using-text-to-columns-to-separate-data/
0
 
xtermieCommented:
Hey no luck with this...I think that the text to columns functionality is exactly what you need in your case....easily done even for a large volume of data.  If you need detailed instructions let me know so I can post instructions.  Also, lmk which version of excel you are using.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.