Excel sorting-making blank rows a part of the row above

J

jmorgs

I do now know how to write the code so that the computer recognizes tha
blank rows below the name are a part of the name above and should not b
seperated. I have a file that is 4 colums long. The first 2 column
are name and I number, but the last two are the person's educatio
backgrounds. A person's name and ID number will only be one row long
however, because they may have more then one degree their educationa
information may very well have more then one row. My problem is when
sort by names, if a person has more then one degree, his/her secon
degree is no longer the row below their name and therefore is no longe
associated with the correct person. For instance, it is formated lik
the following:
Brown 1 bachelors finance
masters accounting
Green 2 bachelors history

When I sort by last names, Mr. Brown's second degree is no longe
underneath his name.
HELP
 
H

hgrove

jmorgs wrote...
...
I have a file that is 4 colums long. The first 2 columns are name
and I number, but the last two are the person's education
backgrounds. A person's name and ID number will only be one
row long, however, because they may have more then one
degree their educational information may very well have more
then one row. My problem is when I sort by names, if a person
has more then one degree, his/her second degree is no longer
the row below their name and therefore is no longer associated
with the correct person.
...

The standard approach is to add an additional column that contains the
same value for the name row and any following blank rows. If your
records began in row 2 with name in column A, you could use the
following formula in E2.

E2:
=IF(ISBLANK(A2),E1,ROW())

and fill E2 down so that there's a column E formula for every row in
your table. These formulas should evaluate to the current row number if
the name field isn't blank or to the row containing the nearest
preceding row in which the name field wasn't blank.

Select the column E range, Edit > Copy, Edit > Paste Special as values.
Then sort the range spanning column A through E on column E.
 

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