Saturday, October 11, 2008

Break Strings in Excel

So many times we needed to import an excel file to a database, receives an excel file filled with people full names, and we need to break it in two other columns regarding the first name and the last name, or even the two together.
This is the way to do it:

First String: =LEFT(A1,FIND(" ",A1,1))

Last String: =RIGHT(A1;LEN(A1)-FIND("*";SUBSTITUTE(A1;" ";"*";LEN(A1)-LEN(SUBSTITUTE(A1;" ";"")))))

All Except the First String: =RIGHT(A1;LEN(A1)-FIND(" ";A1;1))

When ever I have more useful excel string functions, I'll update this post.

0 comments: