Thursday, February 23, 2012

Names and Better Databases

This is one of my Favorite Excel Tricks, and it should be in your arsenal of weapons against Poorly Formatted Data.

If you have been working with Excel for a long time, you undoubtedly have many times been presented with data that is Not in an ideal format. One common case is when you are presented with list of employee names showing the Entire first and last name in each cell in a column.

As I am sure you are aware, Database Best Practices dictate that it is best to Break Down or Parse Your Information into the smallest discreet portions reasonable. Therefore, you would naturally prefer to have the first names in one column and the last names in another column. Of course if you have hundreds of employees in your company, this would be Pure Drudgery to convert manually.

Extracting the first names and last names into their own separate fields (columns) with Convenient Excel Formulas is a Breeze (can you feel it whistling through your hair?).

The Excel Functions that we will be Using in the Formulas are:

A) LEN - Returns the number of characters in a text string

B) FIND – Returns the starting position of one text string within another text string

C) LEFT – Returns the specified number of characters from the start of a text string

D) RIGHT - Returns the specified number of characters from the end of a text string

To extract just the First Name, use the following:

=LEFT(A1, FIND(" ", A1, 1)-1)

To extract just the Last Name:

=RIGHT(A1, LEN(A1)-FIND(" ", A1))

These comparatively simple formulas can really save you tons of work. Don’t be shy, give them a try!

No comments: