Splitting Cells

by Allen Wyatt
(last updated December 26, 2013)

1

When you store a bunch of data in a spreadsheet, a common need is to split cells based on the occurrences of a particular character within those cells. For instance, you might have an address in a cell, such as this:

123 Maple Lane

You might want to put the house number (123) in one cell, the street name (Maple) in another, and the street type (Lane) in a third cell. You can accomplish this easily by using the SPLIT function. If the original address is in cell A1, you could place the following in cell B1:

=split(A1," ")

The first parameter specifies the cell you want to split and the second parameter (a space within quotes) indicates that you want the cell split everyplace there is a space. Once you enter the formula, Sheets splits the contents of cell A1 every place a space occurs and places the results in however many cells are necessary to the right of wherever you placed the formula. Thus, if you put the formula into cell B1, then the results will be in the range B1:D1.

There is a huge caveat here: Since SPLIT uses as many cells as necessary in order to show its results, it is very easy to overwrite information. If the function needs to use multiple cells, it doesn't pay a lot of attention to what was previously in those cells. Thus, it is a good idea to make sure you only use SPLIT when there are enough blank columns to contain all your "split out" data.

There is also another neat use of the split function: It can break information based on multiple delimiters. For instance, you might have the following in a cell:

John Doe, Sr.

If you want to split the text so that each element of the name ends up in it's own cell, you'd actually need to take into account two delimters: a space and a comma. The reason is because if you only split based on spaces, then the last name ends up being "Doe," with the comma at the end. You can include each character on which you want to delimit the text in the second parameter:

=split(A1, " ,")

What you end up with is three columns, with John in the first, Doe in the second, and Sr. in the third. Note that consecutive delimiters (in this case a comma followed immediately by a space) are "collapsed" so that you don't end up with any blank cells.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He  is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Saving and Using a Form

After you have created your custom form, you will need to save it so that you can use it as often as needed. Word makes this ...

Discover More

Finding and Replacing in Text Boxes

Finding and replacing information in a worksheet is easy. Finding and replacing in other objects (such as text boxes or chart ...

Discover More

Squeezing Everything In

Do you have just a line or two of text that 'spills over' onto another printed page? Here are some ways you can compress your ...

Discover More
MORE DRIVETIPS

Deleting a Comment from a Cell

If you no longer have a need for a particular comment in a cell, you'll want to get rid of it. Here are a couple of ways you ...

Discover More

Changing the Legend Location

When you create a chart, Sheets helpfully adds a legend to better explain the data that is in the chart. If you don't want ...

Discover More

Adjusting Cell Alignment

To present your spreadsheet data in just the manner you want, Sheets provides tools that enable you to adjust both horizontal ...

Discover More

Comments for this tip:

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is three minus 1?

2013-12-26 22:58:26

Gautam

A very good tip, would be useful.
thanks.


Links and Sharing
  • Ask a Question
  • Make a Comment
  • Free Business Forms
  • Free Calendars
  • Share