Excel/Roster Sorting


Hi there, I'm writing a roster at the moment in which I have a list of 50 or so candidates who work at 35 different places. I have a list of where they can work as their names are sorted alphabetically. Ive made another spread sheet, sorting out a list of all the staff members that work at each site. The code per line reads something like this:

=IF(COUNTIF(Availability!$C3:$I3,"DSA NG")>0,Availability!$A3,"")

where "DSA NG" will change name depending on which site it is, and C3-I3 are the cells which states where they can work and A3 is the staff members name.

This all works fine, however my roster is all patchy and I'm trying to format it so it will say the places name and list all the staff underneath it with no spaces. I can sort each column individually in reverse alphabetical order (else all the blank cells are at the top) but if I try and select all of the names to be sorted it doesnt seem to work.

My question is this: Is there an easier way to sort it so all the names are directly underneath the respective headings? If yes, can you guide me?

Thanks in advance,


If I understand the situation correctly (you want to sort the names alphabetically), why not change the formula

from  =IF(COUNTIF(Availability!$C3:$I3,"DSA NG")>0,Availability!$A3,"")

to =IF(COUNTIF(Availability!$C3:$I3,"DSA NG")>0,Availability!$A3,"ZZZZZZZZZ")

then sort the names and that ("ZZZZZZZZZ") should sort to the bottom (if not, use a string that will)

You can then delete those dummy entries after the sort.  or you could do

=IF(COUNTIF(Availability!$C3:$I3,"DSA NG")>0,Availability!$A3,if(Z1=1,"ZZZZZZZZZ",""))

then when your ready to sort, put a 1 in Z1. Do the sort, then clear the 1 from Z1

Tom Ogilvy  
About Excel
This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here


All Answers

Answers by Expert:

Ask Experts


Tom Ogilvy


Selected as an Excel MVP by Microsoft since 1999. Answering Excel questions in Allexperts since its inception in 2001. Able to answer questions on almost all aspects of Excel's internal capabilities. If seeking a VBA solution, please specify that in your question itself so I give you the answer you want. [Excel has weak protection - if you are distributing an application, I don't answer questions on how to protect your project from your users.]


Extensive experience.

Master of Science (MS) degree Operations Research (ORSA)

Awards and Honors
Microsoft MVP in Excel.

©2016 About.com. All rights reserved.