To sort a bar chart by bar height in Excel, you must first sort the underlying data table by the relevant values in ascending or descending order, then update the chart — Excel does not automatically re-sort chart elements based on bar height alone. No special add-ins are required; the method works in Excel for Microsoft 365, Excel 2021, Excel 2019, and Excel 2016 on Windows and macOS.
What You'll Need
- A working Excel file (XLSX or XLSM) containing a bar or column chart
- Access to the original data range used to create the chart
- Basic familiarity with Excel sorting (Data > Sort A to Z or Sort Largest to Smallest)
Step-by-Step
- Open your Excel workbook and locate the worksheet that contains both your raw data and the bar chart. Ensure the chart is linked to a contiguous data range (e.g., A1:B10) with category labels in one column (e.g., product names) and numeric values in the adjacent column (e.g., sales figures).
- Select the entire data range, including headers if present. For example, if your data spans rows 1 to 10 in columns A and B, click and drag from cell A1 to B10 — or click cell A1 and press Ctrl+Shift+End (Windows) or Command+Shift+End (macOS) to extend selection to the last used cell.
- Open the Sort dialog box. Go to the Data tab on the Excel ribbon, then click Sort in the Sort & Filter group. If you see only the Sort button without a dropdown, click it directly; if you see a small arrow next to it (indicating a drop-down menu), click that arrow and choose Sort.
- Choose the sort column and order. In the Sort dialog box:
- Under Column, select the column containing the numeric values (e.g., "Sales" or "Value") — this is the column whose bar heights you want to sort by.
- Under Sort On, leave it as Values (default).
- Under Order, choose either A to Z for ascending (smallest bar first) or Z to A for descending (largest bar first).
- Click OK to apply the sort. Excel will rearrange the rows in your data table based on the selected column. The bar chart will automatically update its categories and bar heights to reflect the new order — no further action is needed if the chart is linked to the original range.
- Verify the chart sorting. Scroll to your bar chart and confirm that the bars now appear in ascending or descending order of height, with their labels (e.g., product names) reordered accordingly. If the chart does not update, ensure it is not embedded in a table or protected sheet — see the Troubleshooting section.
Common Mistakes
- Sieving only the chart instead of the data: Excel charts do not have a built-in "sort by value" button. Attempting to click and drag bars manually will not re-sort the chart — bars are static visual representations of data, not interactive elements.
- Sorting only the category labels or only the values separately: If you sort column A (labels) without sorting column B (values), or vice versa, your chart will display mismatched data and labels (e.g., "Apples" paired with "120" when the original row had "Apples" with "85"). Always sort the entire data range together.
- Using filter instead of sort: Filtering hides rows rather than reordering them, so the chart will still show all categories in their original positions (with empty bars for hidden rows). You need to use the Data > Sort command, not Filter.
- Forgetting to include all columns in the selection: If you accidentally select only the value column (e.g., B1:B10) and sort it, Excel may prompt you to expand the selection — if you click Sort Extended or ignore it, the chart may break. Always select the full range (A1:B10) before sorting.
Tips
- Use a table for dynamic sorting: Convert your data range to an Excel Table (select any cell in the data, then press Ctrl+T or go to Insert > Table). Then, click the dropdown arrow in the value column header and choose Sort Smallest to Largest or Sort Largest to Smallest. Tables auto-expand the sort to all columns and keep the chart linked.
- Keep the chart visible while sorting: Resize your Excel window or use View > Split to view both the data and chart simultaneously — this helps confirm the chart updates correctly.
- Try secondary sorting for ties: In the Sort dialog box, click Add Level to add a secondary sort (e.g., sort by sales descending, then by product name ascending). This ensures consistent order when multiple bars have the same height.
- Use the Sort & Filter gallery for quick actions: In newer Excel versions, after selecting a cell in the value column, the Data tab shows Sort A to Z and Sort Z to A buttons — these sort only the visible range but will warn you to expand the selection if needed.
Troubleshooting
- Chart does not update after sorting: First, check if the chart is linked to the data. Right-click any bar > Select Data. In the Legend Entries (Series) section, verify the Values range matches your sorted data (e.g., =Sheet1!$B$2:$B$10). If the range is static and correct, try clicking the chart and pressing F9 to force a recalculation. If the chart is embedded in a table or has a fixed series formula, recreate the chart using the updated data range.
- Sort dialog does not appear or is grayed out: Ensure you have selected a cell inside the data range, not inside the chart. If you selected the chart first, click any empty cell in the worksheet to deselect it, then reselect a data cell and try again.
- Labels appear out of order or mismatched: This indicates incomplete range selection during sorting. Undo the sort (Ctrl+Z), then carefully select the entire data range (including all columns) before sorting again. Double-check that the correct column is chosen as the sort key.
- Chart series order is still wrong after sorting: In some cases, Excel may plot data in a fixed category order if the chart uses an X-axis with text labels (not a category axis). To fix this, right-click the horizontal axis (for bar charts) or vertical axis (for column charts) > Format Axis > under Axis Options, ensure Categories is selected (not Values) and Categories in reverse order is unchecked.
- Sheet is protected: If the worksheet is protected, sorting may be disabled. Go to Review > Unprotect Sheet (you’ll need the password if one was set). After sorting, re-protect the sheet if needed (Review > Protect Sheet).
Frequently Asked Questions
Can I sort a bar chart by height without changing the original data order?
No — Excel requires sorting the source data to reorder chart bars. There is no built-in option to create a "dynamic sort" that only affects the chart visualization. If preserving original order is critical, create a copy of your data, sort the copy, and build a second chart from it.
Why does my bar chart show bars in alphabetical order instead of by height?
This happens when the data is sorted by category labels (e.g., product names) rather than by numeric values. Re-sort your data range using the value column (e.g., sales) as the sort key, not the label column.
Does this work for pie charts or line charts?
No. Pie charts and doughnut charts do not have a categorical axis to sort, and line charts typically rely on x-axis categories (e.g., dates) that should not be reordered arbitrarily. Sorting applies only to bar/column charts where categories are displayed along an axis and mapped to values.
Can I sort a stacked bar chart by total height?
Excel does not provide a direct way to sort stacked bars by their total height. You must calculate the total for each row in a helper column (e.g., =SUM(B2:D2)), then sort the data range using that helper column as the key. The stacked segments will reorder accordingly but may appear rearranged within each bar — this is expected behavior.
Why do my chart labels disappear after sorting?
Labels usually disappear if you accidentally sorted only the values column without including the category column. Undo the sort, select the full data range (e.g., A1:C10), and re-sort using the correct column. Also, check that the chart’s axis labels are enabled: right-click the axis > Format Axis > ensure Linked to source is checked under Axis Options.
Does sorting affect conditional formatting or data validation?
Yes — conditional formatting rules and data validation rules move with their source cells when rows are sorted. However, if your rules use absolute references (e.g., $B$2) or formulas referencing other sheets, verify they still behave correctly after sorting.