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

Strikethrough Shortcut Key

One common type of formatting is strikethrough, which is normally applied from the Font dialog box. There is no built-in ...

Discover More

Automatically Saving Document Copies on Floppy

WordPerfect included a command that allowed users to save a copy of their current document to the A: drive. Word has no ...

Discover More

Calculating the Last Day in a Week Number

Given a particular week number for a year, you may want to figure out the date of the last day in that week. There is no ...

Discover More

Excel Smarts for Beginners! Featuring the friendly and trusted For Dummies style, this popular guide shows beginners how to get up and running with Excel while also helping more experienced users get comfortable with the newest features. Check out Excel 2013 For Dummies today!

More ExcelTips (ribbon)

Excel Charts in PowerPoint

A common place to use Excel charts is in your PowerPoint presentations. How you paste those charts into the presentation ...

Discover More

Changing Axis Tick Marks

Create a chart in Excel, and you may find that the tick marks shown on the axes in the chart aren't to your liking. It is ...

Discover More

Formatting Axis Patterns

Create a chart in Excel and you can then modify it almost any way you desire. One modification is to adjust the color or ...

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 four minus 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.