Excel question: Separating cell contents into separate cells

I don’t even know if this is possible, but if it is, it would simplify things for me immensely.

Say I have a class of identifying numbers, consisting of a caseload number connected to a worker number by a hyphen/dash. I want to separate the caseload number and the worker number out so that I can sort by either one. Is there any way to do this quickly and (preferably) automatically? I have tried using find/replace to change the hyphens into spaces, but after that I’m stuck. How do you separate two sets of numbers from sharing space in one cell to having their own cells?

Go to the Data tab, then Text to Columns. You should be able to split any column of data using the hyphen as the delimiter.

I’m assuming that you have a column containing the cells with a hyphen, and a blank column for the second group of cells. (If you don’t have a blank column, then create one).

The easiest way might be to copy the column with the cells into the blank column, then:
(1) Select the first column, and use Replace, replacing “-" with a blank.
(2) Select the second column, and use Replace, replacing "
-” with a blank.

The “*” is a wildcard, that matches and group of characters.

The only problem with this method is if your numbers have leading zeroes, and your want to retain them. For example, if a cell has “001-002”, then this method will give you “1” in the first cell and “2” in the second cell. There is a way to retain leading zeroes, but it’s more complex than the method I’ve given.

Telemark’s method works too: I had never used that command, and I suspect it might be useful to me from time to time. In that method, you can preserve leading zeroes by specifying that the columns containing numbers with leading zeroes are “Text” and not “General”.

Text to Columns worked perfectly! Thank you both!

Ah, Text to Columns, my dear friend.