Sorting Complicated List by Two Columns - Excel 2003

G

Guest

I have a list of names, represented below, but in reality about 1,000 names
long.

Column A has each name ONCE.

Column B has each name multiple times, but in no particular order.

I want to have the names in Column B be at the same place as column A. In
other words, for the name "John" in Column A, I want each instance of "John"
in Column B to come under that . What this will require is Excel to
AUTOMATICALLY insert additional cells (so that if John appears 20 times in
Column B, there are 19 blank lines under "John" in Column A).

PLEASE HELP!!!

Jeff John
John John
Saul John
Ralph Jeff
Jeff
Jeff
John
John
Saul
Saul
Jeff
Ralph
Jeff
Ralph
Ralph
Ralph
Ralph
John
 
P

Pete_UK

Insert a new column C and leave it blank. Click in the first blank
cell in column A, then press F5 (GoTo), click Special, then click
Current Region. Press F5 again, click Special and then click Blanks.
This should have highlighted all the blank cells in column A, with the
active cell being the first blank cell in column A.

Then type = and click on the cell in column B next to where the
activecell is and then continue the formula by typing &"-". Then hold
the CTRL key down and press <Enter>. This will have copied the formula
into all those blank cells, so that you end up with something like
"John-", "Ralph-" etc, the formula being =B5&"-" in A5 (for example).

Delete the column C that you inserted earlier and fix the values in
column A using Edit | Paste Special.

Now you can sort the data by column A - all the names "John-" will
appear under John.

You can now apply autofilter on column A - Custom, Contains (scroll
down to see this), and "-" (without the quotes). This will display all
the records with the new names in. Click in the first visible cell and
press <delete>, and then <copy> and paste the empty contents over all
the rest of the visible names in column A. Remove the filter and you
should have what you want.

Hope this helps.

Pete
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top