Sorting by line when multiple lines correspond to it?

J

Jonathan

Hi all,

I am working on creating a contact list and I want to be able to sort by
client name, however, there are several lines for each client name, so when I
sort by client name currently, the first line will come up fine, but then the
rest of the associated lines will all get grouped together as being "blank."
Is there any way to sort without writing the client name on each line?
Please see below. I would like all the info for client A, B, C, etc. to move
when I sort rather than just the top line.

Thanks!

Client Phone Email
A 654654 weffwefwe
654654 werw
22477 545487
323211 57778768
B 3.21132E+15 6354654
4564 5887687
C asdf asdf
sadf afds
asfd weffwefwe
asdf afds
D f asdf
E wef sdaf
sd a
d sdaf
s df
F s sdaf
 
P

Pete_UK

Use a helper column (eg column D) - this will only be used temporarily
and can be deleted afterwards. In D2 you can enter this formula:

=IF(A2="",A1+0.01,INT(A1)+1)

Copy this down column D to cover all your data - it will give you a
number incremented by 0.01 for each name, and thus will allow up to
100 entries under each name. Fix the values in column D by
highlighting the column, click <copy> then Edit | Paste Special |
Values | OK | <Esc>.

Now you can sort the data using the helper column, to retain the sub-
rows under the main row.

Hope this helps.

Pete
 
J

Jim Cone

Another way...
Use John Walkenbach's tip here...
http://j-walk.com/ss/excel/usertips/tip040.htm
Except between steps 5 and 6 (while the "blank" cells are still selected);
Format the cells with a custom number format of ";;;" - (three semi-colons).
Then continue with step 6.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



"Jonathan" <
wrote in message
Hi all,
I am working on creating a contact list and I want to be able to sort by
client name, however, there are several lines for each client name, so when I
sort by client name currently, the first line will come up fine, but then the
rest of the associated lines will all get grouped together as being "blank."
Is there any way to sort without writing the client name on each line?
Please see below. I would like all the info for client A, B, C, etc. to move
when I sort rather than just the top line.
Thanks!

Client Phone Email
A 654654 weffwefwe
654654 werw
22477 545487
323211 57778768
B 3.21132E+15 6354654
4564 5887687
C asdf asdf
sadf afds
asfd weffwefwe
asdf afds
D f asdf
E wef sdaf
sd a
d sdaf
s df
F s sdaf
 
G

Gord Dibben

Make your life easier by adding the client names in the blank spaces.

Select Client column and F5>Special>Blanks>OK

Type = sign in active blank cell then hit CTRL + ENTER.

Copy that column and paste special(in place)>values>ok>esc


Gord Dibben MS Excel MVP
 
Top