How to Sort by Column B in Google Sheets

How-to basics · Updated December 1, 2026

Sorting by a specific column, like Column B, is one of the most common tasks in Google Sheets. It lets you reorder your entire dataset alphabetically, numerically, or by date based on the values in that column. The quickest way is to right-click the column letter and choose Sort sheet A→Z or Sort sheet Z→A. But there are also menu-based and formula-based methods for more control. Below is everything you need, from the basic click to advanced sorting with the SORT function.

What You’ll Need

  • A Google account and access to Google Sheets (free with a Google account).
  • A spreadsheet with data in Column B (or any column you want to sort by).
  • Basic familiarity with selecting cells and using the toolbar (no prior sorting experience needed).

Step-by-Step

Method 1: Sort the Entire Sheet by Column B (Quickest)

  1. Open your Google Sheets document in a web browser (Chrome, Firefox, Safari, etc.).
  2. Locate the column header B at the top of the sheet. Click on the letter B to select the entire column. This highlights the whole column.
  3. Right-click the highlighted column. A context menu appears.
  4. Hover over Sort sheet A→Z (for ascending order: A to Z, smallest to largest) or Sort sheet Z→A (for descending order: Z to A, largest to smallest). Click your choice.
  5. Google Sheets will reorder all rows in the sheet based on the values in Column B. If your sheet has a header row (like “Name” or “Date”), it will be kept at the top automatically.

Method 2: Sort a Specific Range by Column B (Without Affecting Other Data)

  1. Select the range of cells you want to sort. For example, click and drag from cell A1 to D20 if your data spans columns A through D and rows 1 through 20. Include the header row if you have one.
  2. Click the Data menu at the top of the screen.
  3. Choose Sort range from the dropdown.
  4. In the dialog box that appears, check the box Data has header row if your selected range includes headers. This ensures the header stays in place.
  5. Click the Sort by dropdown and select the column that corresponds to Column B (it might be listed as “Column B” or by its header name, e.g., “Last Name”).
  6. Choose A→Z or Z→A as the sort order.
  7. Click Sort. Only the selected range is reordered; data outside the range stays untouched.

Method 3: Use the SORT Function (For a Dynamic Sorted Copy)

  1. Decide where you want the sorted data to appear. For example, if your original data is in columns A and B (rows 1 to 10), you might put the sorted copy in columns D and E.
  2. Click on the cell where you want the sorted data to start (e.g., D1).
  3. Type the formula: =SORT(A1:B10, 2, TRUE). Here, A1:B10 is the range to sort, 2 means sort by the second column (Column B), and TRUE means ascending order (A→Z). Use FALSE for descending.
  4. Press Enter. The sorted data appears starting at D1, and it updates automatically whenever you change the original data.
  5. If you have a header row, include it in the range and the formula will sort it too. To keep the header out of the sort, you can use a more complex formula like =SORT(A2:B10, 2, TRUE) and manually copy the header to D1.

Common Mistakes

  • Sorting only one column: If you select only Column B and sort, you’ll reorder that column independently, breaking the relationship with other columns. Always select the entire data range or use “Sort sheet” to keep rows intact.
  • Forgetting the header row: When using “Sort range,” if you don’t check “Data has header row,” the header gets mixed into the sorted data. Always check that box if you have headers.
  • Accidentally sorting merged cells: If your data contains merged cells, sorting can cause errors or misalignments. Unmerge cells before sorting if possible.
  • Using the SORT function incorrectly: The second argument in SORT is the column index number, not the column letter. For Column B, use 2, not “B”.

Tips

  • Use filters for quick sorting: Click the funnel icon in the toolbar to add filter buttons to each column header. Then click the arrow in Column B and choose “Sort A→Z” or “Sort Z→A”. This is great for temporary sorting without changing the sheet permanently.
  • Sort by multiple columns: In the “Sort range” dialog, click “Add another sort column” to sort by Column B first, then by Column C, etc. This is useful for grouping data.
  • Keyboard shortcut: On Windows, select your range and press Alt + D then S to open the sort menu. On Mac, use Option + D then S.
  • Use the SORT function for dynamic reports: If you often update your data, the SORT function saves time because it recalculates automatically. Just make sure you have enough empty space for the output.

Troubleshooting

  • Sorting doesn’t work or errors appear: Check if your range includes merged cells. Google Sheets may refuse to sort merged cells. Unmerge them first (select the merged cells, go to Format > Merge cells > Unmerge).
  • Header row gets sorted: In “Sort sheet,” headers are automatically detected, but if your header is not in row 1, you’ll need to use “Sort range” and specify the header row. In “Sort range,” make sure the “Data has header row” checkbox is ticked.
  • Data is sorted but rows are misaligned: This happens when you sort only a single column. Undo with Ctrl+Z (Windows) or Cmd+Z (Mac), then select the entire data range before sorting again.
  • The SORT function returns an error like #VALUE! This usually means the range or column index is incorrect. Double-check that the range exists and the column index (e.g., 2 for Column B) is within the range’s width.
  • Sort order seems wrong (e.g., numbers as text): If your Column B contains numbers stored as text (often with a green triangle in the corner), sorting may not work numerically. Select the column, go to Data > Split text to columns (or use Format > Number > Number) to convert them to real numbers.

Frequently Asked Questions

Can I sort by Column B without moving the header row?

Yes, both the “Sort sheet” and “Sort range” methods automatically keep the header row in place if you have it in row 1 and check the “Data has header row” option in “Sort range”.

What if I want to sort by Column B but keep some rows fixed at the top?

You can freeze rows above the data (View > Freeze > 1 row) and then sort the remaining range. The frozen rows will stay put.

Does the SORT function work with text, numbers, and dates?

Yes, SORT handles all data types. For dates and numbers, use ascending (TRUE) for oldest/smallest first, descending (FALSE) for newest/largest first.

How do I sort by Column B in descending order?

Right-click Column B and choose “Sort sheet Z→A”, or in the “Sort range” dialog select “Z→A”. For the SORT function, change the last argument to FALSE.

Can I sort by Column B in Google Sheets on my phone?

Yes, the Google Sheets mobile app supports sorting. Tap the column letter B to select it, then tap the three-dot menu and choose “Sort A–Z” or “Sort Z–A”. The steps are similar but the interface is touch-based.

Why does my sort put blank cells at the bottom?

By default, Google Sheets places blank cells at the end of the sorted data. If you want blanks at the top, you can add a helper column with a formula like =ISBLANK(B2) and sort by that first, but this is an advanced workaround.

Related

Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.

More in How-to basics

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.