# Formula to alphabetize last names based on criteria

#### Stuepef

##### Board Regular
I have a list of employee last names that I would like to alphabetize based on the plan chosen. I created the alphabetize formula and the criteria formula, but need assistance combining them if possible:

Alphabetize formula:
Code:
``[COLOR=#333333]=IFERROR(INDEX(A\$2:A\$96,MATCH(ROWS(A\$2:A2),INDEX(COUNTIFS(A\$2:A\$96,"> ",A\$2:A\$96,"<="&A\$2:A\$96),0),0)),"")[/COLOR]``

Criteria Formula (plan 1):
Code:
``[COLOR=#333333]{=IFERROR(INDEX(\$A\$2:\$A\$16,SMALL(IF(\$B\$2:\$B\$16=1+0,ROW(\$A\$2:\$A\$16)-(ROW(\$A\$2)-1)),ROWS(\$2:2))),"")}[/COLOR]``

Employee List & Plan:
EmployeePlan Selection
 Richards

<tbody>
</tbody>
3
 Cone

<tbody>
</tbody>
1
 Flairty

<tbody>
</tbody>
1
 Hector

<tbody>
</tbody>
2
 James

<tbody>
</tbody>
3
 Paige

<tbody>
</tbody>
1
 William

<tbody>
</tbody>
1
 Wood

<tbody>
</tbody>
3
 Rose

<tbody>
</tbody>
2
 Maggie

<tbody>
</tbody>
2
 Sharon

<tbody>
</tbody>
1
 Jesse

<tbody>
</tbody>
3
 Lori

<tbody>
</tbody>
2
 Kim

<tbody>
</tbody>
2
 Jason

<tbody>
</tbody>
3

<tbody>
</tbody>

The sample workbook and employee information was posted at Excel Help Forum at: https://www.excelforum.com/excel-fo...lphabetize-based-on-criteria.html#post5082582

### Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.

Replies
7
Views
95
Replies
26
Views
501
Replies
3
Views
97
Replies
1
Views
194
Replies
1
Views
142

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

1,163,487
Messages
5,831,972
Members
430,099
Latest member
rdhoy

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back