Friday, January 13, 2012

yogi_Sort First And Last Name Columns Then Merge Them As LastName comma FirstName

Yogi Anand, D.Eng, P.E.                                         Google Spreadsheet                  
user lalunaselena said:
How do I sort First & Last name columns, joining to one cell in third column
First     |    Last     | Sorted
Sammy     |    Sue      |
Sally     |    Sue      |  
John      |    Smith    |  
Jane      |    Doe      |
I've got three columns: First name, Last name, Sorted Names. I want to sort by Last, then First, then join First & Last column and report in alphabetical order in Sorted column. I have gotten as far as this: =arrayformula(sort(D2:D)&", "&_____) I want Sorted to report: 
Doe, Jane
Smith, John
Sue, Sally
Sue, Sammy
I don't know how to get it to sort second priority by First column. If I do =arrayformula(sort(D2:D)&", "&sort(C2:C)), it sorts last name and outputs that, then it sorts first name and outputs that, but then the first and last names are mismatched. e.g. Sue, Jane
following is a solution to the problem: