Sorting within a Chart

Written by Allen Wyatt (last updated December 26, 2020)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365


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 Microsoft 365.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Setting Embellishment Spacing in the Equation Editor

The equation editor is a great tool for adding mathematical equations into your document. The placement of many elements ...

Discover More

AutoFill with Random Numbers

When entering data into a worksheet, you may have a need to fill a range of cells with a group of random numbers. This ...

Discover More

Using Duplex Printing

Want to print on both sides of a piece of paper? Some printers have the capability to do two-sided printing ...

Discover More

Solve Real Business Problems Master business modeling and analysis techniques with Excel and transform data into bottom-line results. This hands-on, scenario-focused guide shows you how to use the latest Excel tools to integrate data from multiple tables. Check out Microsoft Excel 2013 Data Analysis and Business Modeling today!

More ExcelTips (ribbon)

Adding Data Labels to Your Chart

Adding labels to a chart can make the information presented in the chart more understandable. Excel allows you to add ...

Discover More

Changing Chart Size

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

Creating Charts in VBA

Most charts you create in Excel are based on information stored in a worksheet. You can also create charts based on ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 6 - 0?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)


This Site

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.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.