How to Sort & Count in Excel

By Steve Lander

If a restaurant used Excel, its menu could be alphabetical.
i NA/ Images

Spreadsheets have come a long way from when they were invented as a piece of electronic ledger paper for a class at Harvard Business School. Modern versions of Excel can do many things including serve as a simple database program and list manager. The ability to sort and count fields could let you, for example, track both who is attending a meeting and what percentage of invitees are attending. Both the sort and count functions in Excel are relatively easy to use.

Sorting in Excel

Open Excel.

Click the "File" tab, click "Open," select the file that you want to open in the file selector box and click the "Open" button. If you opened Excel by double-clicking a file, skip this step.

Highlight the range that you want to sort by holding down your left mouse button and dragging it from the upper-left to the lower-right corner of the block.

Click the "Data" tab, then click "Sort."

Click the check box next to "My data has headers" if the top row of your selected range is headers that you don't want sorted.

Click the first "Sort By" field and select which column you want to use for sort order. For example, if you are sorting a mailing list, you might want to sort it by the last name or the zip code of the list members.

Click the "Order" drop down menu to determine how you want the field to be sorted.

Click "Add Level" and repeat steps six and seven if you want to do a multi-level sort. For example, if you wanted to sort by zip code and then by last name in a zip code, you'd set the zip code as your first sort level, then add last name as the second level.

Click "OK" to sort your spreadsheet.

Counting in Excel

Click on a cell outside the range that you want to count.

Type the "=" key to let Excel know that you will be entering a function.

Type "COUNT(," COUNTA(" or "COUNTBLANK(" without any comma or quotation marks. The "COUNT" function will tell you how many cells in your range contain numbers while "COUNTA" shows how many cells aren't blank. "COUNTBLANK" tells you how many blank cells the range contains.

Click and drag over the cells that you want to have counted. Excel will fill their addresses into your "COUNT" command line.

Type ")" and press the "Enter" key. Excel should now display the count, while the cell should have a command that looks something like "=COUNT(E2:E11)" without the quotation marks.


These procedures work in Excel 2013 and may or may not work in other versions of Excel or in other spreadsheet programs.