One of the most common functions in an Excel spreadsheet is sorting data alphabetically.

This feature is extremely helpful for organizing lists of names, cities, and more. While there are several ways to alphabetize rows and columns, the most reliable way is to give instructions within the “Sort” feature, which is found in the “Data” tab.

Additionally, there are shortcuts to quickly reorganize cells from “A to Z” or from “Z to A.” These shortcuts are found in both the “Data” and “Home” tabs.

Excel automatically tries to alphabetize vertically by column, but you can easily adjust this setting to sort horizontally by row.

Here's how to do it.

Check out the products mentioned in this article:

Microsoft Office 365 Home (From $99.99 at Best Buy)

Macbook Pro (From $1,299 at Best Buy)

Microsoft Surface 2 (From $1,999 at Best Buy)

How to alphabetize columns in Excel

1. Open the Excel spreadsheet you need to alphabetize on your Mac computer or PC.

2. Select the data you want to sort, or do not highlight anything if you wish to sort the entire document.

3. Navigate to the "Data" tab found at the top of the page.

image1_az

Foto: Find the "Data" tab at the top of your spreadsheet.sourceMarissa Perino/Business Insider

4. Click "Sort" located in the middle of the toolbar.

5. This will open a pop-up with details of how to sort your rows and columns. Excel will automatically populate instructions to sort data by Column A from A to Z.

6. Click the "Column" drop-down menu to change to Column B (or another column if you have more than two).

image2_az

Foto: You can sort data by any column.sourceMarissa Perino/Business Insider

7. If your list has headers, check the box in the upper right-hand corner. This will eliminate the top row from the sorting, and the column will now be labeled as such (instead of Column A).

8. Select whether you still want to organize by this first column or from a different column by clicking the "Column" dropdown menu again.

9. Select whether you want to alphabetize from "A to Z" or from "Z to A" from the dropdown menu under "Order."

image3_az

Foto: Select how you'd like to alphabetize.sourceMarissa Perino/Business Insider

10. Press "OK" after making your selections. This will automatically repopulate your columns in alphabetical order (or backwards, if you choose).

image4 az

Foto: Your data will be reorganized by column.sourceMarissa Perino/Business Insider

These options, along with quick shortcuts, are also found in the "Home" tab.

How to alphabetize by row in Excel

1. You can also alphabetize by row in the same "Sort" option.

2. Open the "Sort" popup again, and click the "Options…" button.

image5_az

Foto: Click "Options…"sourceMarissa Perino/Business Insider

3. You will be asked if you want to sort from top to bottom or from left to right. Select "Sort left to right" to alphabetize by row instead. (Excel automatically tries to alphabetize by column first.)

4. Click "OK."

image6_az

Foto: Switch to alphabetizing from left to right.sourceMarissa Perino/Business Insider

5. You can also click the minus (-) button to remove the column action entirely, and start over by creating a new instruction. Click the plus (+) button and then "Options…" to specify ordering by row.

6. Remember to check "My list has headers" if this applies.

7. Select whether you want to alphabetize from "A to Z" or from "Z to A" from the dropdown menu under "Order."

image7_az

Foto: Provide instructions to order data by row.sourceMarissa Perino/Business Insider

8. Press "OK" after making your selections. This will automatically repopulate your columns in alphabetical order (or backwards, if you choose).

image8 az

Foto: Your data will be reorganized by column.sourceMarissa Perino/Business Insider

These options, along with quick shortcuts, are also found on the "Home" tab.

How to alphabetize in Excel using shortcuts

You can also quickly alphabetize by clicking the "AZ" or "ZA" shortcuts. This is an easy way to reorder cells, especially for highlighting just a small batch of data.

However, Excel will automatically try to sort by your first column (or by your last saved instructions), so it's often best to use the "Sort" feature to specify rows or columns as described above.

1. Select the cells you want to alphabetize.

2. Navigate to the "Data" tab, where you will see "AZ" and "ZA" buttons located in the center of the toolbar next to the "Sort" feature.

3. Click which way you want to organize cells.

image9_az

Foto: Find the alphabetizing shortcuts in the "Data" tab.sourceMarissa Perino/Business Insider

4. Depending on what selection you made, you may be greeted with a pop-up confirming this area of your spreadsheet. Select "Continue with the current selection" followed by "Sort..." if this happens. This will reorder just the data you highlighted. Click "Cancel" if you made a mistake and would rather sort the entire document.

image10 az

Foto: Continue with your current selection to sort cells.sourceMarissa Perino/Business Insider

5. You can also find these "AZ" and "ZA" shortcuts in the "Home" tab.

image11_az

Foto: Find the alphabetizing shortcuts in the "Home" tab.sourceMarissa Perino/Business Insider

Related coverage from How To Do Everything: Tech: