by Allen Wyatt
(last updated December 26, 2020)
Charlie has some data that he used to create a bar chart. If he sorts the data on which the X axis is based, he can control the order in which the bars appear in the chart. It would be helpful to Charlie, though, if he could order the bars in the chart (from lowest to highest) without sorting the data on which the chart is based. He wonders if there is a way to sort the data series along the X axis without modifying his original data.
You cannot sort the actual bars in the chart (though that would be cool if you could); Excel provides no capability to do this. There are two ways that you can approach this issue, however. While it may not seem so at first, both approaches utilize the same concept, they just go about it differently.
Perhaps the easiest approach is to add helper columns to your original data table and then base the chart on those columns instead of the original. For instance, you could use the new SORT function to create helper columns that put your data in the desired sorted order, and then base your chart on that. The original data remains as it is, and you get the chart in the desired order.
The second potential solution is similar to the helper-column approach, as already mentioned. Instead of adding new columns, however, you simply add a PivotTable that is based on your data. The PivotTable can be massaged to present (and organize) just the data you want in your chart. You can then create a bar chart based on what is in the PivotTable. This approach is particularly appropriate if your original data is complex or multitudinous. The benefit of removing the chart from the original data by one step is that you don't need to reorganize the original data; it can remain as you desire.
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (13816) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and Excel in Office 365.
Program Successfully in Excel! John Walkenbach's name is synonymous with excellence in deciphering complex technical topics. With this comprehensive guide, "Mr. Spreadsheet" shows how to maximize your Excel experience using professional spreadsheet application development tips from his own personal bookshelf. Check out Excel 2013 Power Programming with VBA today!
Place a chart on a worksheet and you may not be satisfied with its size. Changing the size of a chart is a simple process ...Discover More
Once you create a chart, you aren't limited to keeping the data series in the order they originally appeared. You can ...Discover More
When your chart contains dates along one axis, you can set bounds on the way the chart is displayed. What causes, though, ...Discover More
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.