Last name first name question

K

kevs

I notice that if I have a list I can make a columns for last name and first
name.

But I did test and put peoples first and then last name in same column.

Then I did a sort and it worked out that many names with same first name
then sorted perfectly by the last name too.

How does Excel do this? It knows to sort the last name too, even though
it's not even in its own column? Does this make need for separating last
and first name in separate columns un-needed? Thanks!!!!!!!!!!
 
J

J.E. McGimpsey

kevs said:
I notice that if I have a list I can make a columns for last name and first
name.

But I did test and put peoples first and then last name in same column.

Then I did a sort and it worked out that many names with same first name
then sorted perfectly by the last name too.

How does Excel do this? It knows to sort the last name too, even though
it's not even in its own column? Does this make need for separating last
and first name in separate columns un-needed? Thanks!!!!!!!!!!

That's the way a sort works. Say you had

Joe Schmo
Joe Blow
Joe Zoe


when the sort sees those names, it doesn't see first or last names,
it sees strings of ASCII code values:

74 111 101 32 83 99 104 109 111
74 111 101 32 66 108 111 119
74 111 101 32 90 111 101

Since the first differentiation occurs after the space (ascii 32),
the sort will put the string with ascii 66 in the 5th character
first, ascii 83 second, and ascii 90 third.
 
K

kevs

That's the way a sort works. Say you had

Joe Schmo
Joe Blow
Joe Zoe


when the sort sees those names, it doesn't see first or last names,
it sees strings of ASCII code values:

74 111 101 32 83 99 104 109 111
74 111 101 32 66 108 111 119
74 111 101 32 90 111 101

Since the first differentiation occurs after the space (ascii 32),
the sort will put the string with ascii 66 in the 5th character
first, ascii 83 second, and ascii 90 third.
Thanks JE, that good info, never knew that. So Excel sees everything in
numbers? Is there any advantage to make that separate column for last name?
 
J

J.E. McGimpsey

kevs said:
Thanks JE, that good info, never knew that. So Excel sees everything in
numbers? Is there any advantage to make that separate column for last name?

Ultimately, yes, but what I was trying to point out was that "Joe
Schmo" was not two "words" to the XL sort engine, but rather a
string of 9 characters, one of which happens to be a space character.

The advantage to making last name a separate column is that you can
sort on last name without regard to first name (i.e., all Smiths
will be together rather than all Joes).
 

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