Excel Plotted My Bar Chart Upside-Down
by Jon Peltier
Thursday, January 19th, 2012
Peltier Technical Services, Inc., Copyright © 2012.
Licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.
Here’s a problem that I’ve heard people ask (and complain) about. They’ll have data in their workbook, neatly sorted from top to bottom. When they make a bar chart, the sorting is reversed, with the Bottom data appearing at the top of the chart. Not only that, but the series are in backwards order too. If they sort the data in reverse order, the chart’s categories look right, but now the worksheet is upside-down, and the series are still in the wrong order.

The reason for this arrangement is logical, once you figure it out. To illustrate, let’s start with this data. Yes, the data in column A is mixed up. Instead of 1-2-3-4, it goes 1-3-2-4, to help illustrate differences between XY and Line charts at the same time.

Here is an XY chart made from this data. Looking at Series 1, we see it starts at X=1, proceeds to X=3, then X=2, and finally X=4. No surprise, since it’s following the data, which as I pointed out above, is in mixed up order.

Big deal, no surprises. But let’s look at the chart axes for a moment, and review 4th grade math.
By default, the two axes will be located along the bottom and left edges of the chart. Where the axes intersect is called the origin, and it is where both axes have their minimum values (we’re dealing with non-negative data). Lower values are plotted closer to the origin, and higher values further away.
Let’s make a Line chart with the same data. It looks different from the XY chart. No, the series are formatted the same, with markers and lines. But check out the horizontal axis. The numbers are not sorted numerically, they are listed in the order they appear in the worksheet, as if they have no numerical value. In fact, in line, column, area, and bar charts, Excel treats X values as non-numeric labels. (Unless the X values are dates, and I’ll cover that another time.)

Note that the axes still cross at the origin in the lower left of the chart. Lower Y values are closer to the origin, and X values encountered earlier in the worksheet are closer to the origin.
Okay, easy enough. In a line chart, Excel lists the X axis labels in the same order as in the worksheet, and the origin is at the bottom left of the chart.
Same with a column chart. Note in the column chart that the order that series are clustered is also the same order as in the worksheet.

Now let’s make a problematic bar chart. 1 is in the top of the worksheet range, but at the bottom of the axis. But remember, the origin is at the bottom left, and the lowest values and first labels are located closest to the origin. So the “1″ label on the vertical axis is closest to the origin, that is, lowest in the chart, even though it was highest in the worksheet. The series are also in the order they are because series 1 is closest to the origin.

If you really need the chart to be arranged the other way, it’s a simple two-step fix. First, format the vertical axis, and check the box for “Categories in reverse order”.

See, now the top label in the worksheet is also the top label in the chart. Reversing the categories has moved the origin to the top left of the chart, so the bottom axis is now at the top of the chart. Note also that the series are now listed in the expected order.

If you want the horizontal axis back at its customary bottom position, format the vertical axis again. (You can do this step at the same time as the earlier Format Axis step.) Select the option button for “Horizontal axis crosses: At maximum position.”

Since the vertical axis maximum is now at the bottom, that’s where the horizontal axis appears.

Now we know enough to go back and fix the original chart. Format the vertical axis, reverse the category order and make the horizontal axis cross at the maximum.

Top is Top, Bottom is Bottom, series are plotted in 1-2-3 order, and we can finally rest easy.
Related Posts:
- Why Are My Excel Bar Chart Categories Backwards?
- Integer Values on Line Chart Category Axis
- Peltier Goes Bar Hopping
- Line Charts vs. XY Charts
- Text Labels on a Horizontal Bar Chart in Excel
- Tax the Rich, or Deceptive Axis Scales
Posted: Thursday, January 19th, 2012 under Charting Principles.
Comments: 3
Comments
Comment from Calvin Graham
Time: Thursday, January 19, 2012, 5:03 am
Or for Excel 2003 users, right click that up/down/vertical axis >> Format Axis >> Select the second Tab >> The two boxes to tick are at the bottom
Once again this blog has successfully managed to show me something I somehow missed in the last 10 years…
Comment from mattmaison
Time: Thursday, January 19, 2012, 11:30 am
Great tip! Thanks! I always just re-sorted manually.
Comment from Meic Goodyear
Time: Friday, January 20, 2012, 4:01 am
Excel 2003 users can get even more control by right-clicking on a series, >> Selected Object >> Series order, then Move Up / Move Down as desired.






Write a comment
I welcome comments from my readers. If you have an opinion on this post, if you have a question or if there is anything to add, I want to hear from you. Whether you agree or disagree, please join the discussion.
If you want to include an image in your comment, post it on your own site or on one of the many free image sharing sites, and include a link in your comment. I'll download your image and insert the necessary html to display the image inline.
Read the PTS Blog Comment Policy.