ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   An If/Then Sort? (https://www.excelbanter.com/excel-discussion-misc-queries/96658-if-then-sort.html)

mcsmith1x

An If/Then Sort?
 
Recently converted all data from an old program to Excel list of ex-students
for a reunion. New request is to sort by Maiden name for the women, and Last
Name for the men for the book. First sort - YearGrad; Second Sort - either
maiden or last name. Can I somehow say sort by maiden unless blank, then sort
by last name?
--
Working Mom (redundant wording)

Dave Peterson

An If/Then Sort?
 
I'd add another column--call it "name to Sort"

then use a formula to fill it:

=if(c2<"",c2,d2)

Where C2 held the maiden name and D2 held the current last name.



mcsmith1x wrote:

Recently converted all data from an old program to Excel list of ex-students
for a reunion. New request is to sort by Maiden name for the women, and Last
Name for the men for the book. First sort - YearGrad; Second Sort - either
maiden or last name. Can I somehow say sort by maiden unless blank, then sort
by last name?
--
Working Mom (redundant wording)


--

Dave Peterson

mcsmith1x

An If/Then Sort?
 
Awesome! It works!
--
Working Mom (redundant wording)


"Dave Peterson" wrote:

I'd add another column--call it "name to Sort"

then use a formula to fill it:

=if(c2<"",c2,d2)

Where C2 held the maiden name and D2 held the current last name.



mcsmith1x wrote:

Recently converted all data from an old program to Excel list of ex-students
for a reunion. New request is to sort by Maiden name for the women, and Last
Name for the men for the book. First sort - YearGrad; Second Sort - either
maiden or last name. Can I somehow say sort by maiden unless blank, then sort
by last name?
--
Working Mom (redundant wording)


--

Dave Peterson


ivory_kitten

An If/Then Sort?
 
You could add an extra column for sorting, say SortName with a formula:

=IF(MaidenName="",Surname,MaidenName)

Hope this helps

"mcsmith1x" wrote:

Recently converted all data from an old program to Excel list of ex-students
for a reunion. New request is to sort by Maiden name for the women, and Last
Name for the men for the book. First sort - YearGrad; Second Sort - either
maiden or last name. Can I somehow say sort by maiden unless blank, then sort
by last name?
--
Working Mom (redundant wording)



All times are GMT +1. The time now is 08:27 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com