Manual sorting of pivot table bars in Excel

I have data in a table. Let's say, like this:



I can create a pivot table, which looks like this:



And bar chart, which looks like this:



But notice how the bars are sorted alphabetically. That's not good, as it doesn't make logical sense (it should be Bad...OK...Good). I have the option to sort by count, but that doesn't provide the correct order, either.


How do I sort manually? Note that my real data is much larger, with many more questions, so doing it manually with COUNT and IFCOUNT would be a major headache.


[Edited by Moderator]

Original Title: Manually sorting pivot tables


Posted on Oct 9, 2025 11:23 AM

Reply
Question marked as Top-ranking reply

Posted on Oct 9, 2025 6:00 PM

Did you see my responses in your other thread?


How do I force sorting in a pivot table o… - Apple Community


Pivot Tables and Charts based on them are convenient for quick data analysis on the fly. But what you get in flexibility you give up in control over final presentation.


This is true in both Numbers and Excel. You can filter Pivot Tables, and remove Grand Total Rows and Columns, but you can't set the column order.


If you need a table and chart in a specific order that you can control, you can easily create a summary table by using SUMIFS, like this:




Note that you need to enter this formula just once, in B2. Then fill it or copy to the right and down in the summary table.


Then base your chart on that table instead of the Pivot Table. Note that you can now adjust the order of the columns in the Chart (if needed) by clicking on a series column in the chart and changing the value in the Order dropdown.




SG

[Edited by Moderator]

6 replies
Question marked as Top-ranking reply

Oct 9, 2025 6:00 PM in response to G_Luv

Did you see my responses in your other thread?


How do I force sorting in a pivot table o… - Apple Community


Pivot Tables and Charts based on them are convenient for quick data analysis on the fly. But what you get in flexibility you give up in control over final presentation.


This is true in both Numbers and Excel. You can filter Pivot Tables, and remove Grand Total Rows and Columns, but you can't set the column order.


If you need a table and chart in a specific order that you can control, you can easily create a summary table by using SUMIFS, like this:




Note that you need to enter this formula just once, in B2. Then fill it or copy to the right and down in the summary table.


Then base your chart on that table instead of the Pivot Table. Note that you can now adjust the order of the columns in the Chart (if needed) by clicking on a series column in the chart and changing the value in the Order dropdown.




SG

[Edited by Moderator]

Oct 9, 2025 3:10 PM in response to G_Luv

I see your concern - there's no mechanism to override the sort of the pivot table data on the chart - your options are pretty much ascending or descending, and that's it.


I was able to get a result similar to what you're aiming for by fudging the data a little. Instead of 'Bad' and 'OK' I set the cell values to " Bad" and " OK" (note the leading space). This forced 'Good' to be sorted alphabetically last, with the small cost of the leading space in the other columns. Probably not ideal, and it may not scale, but it was my first thought.


The other thought I had was that this is an unusual way of presenting the data. Wouldn't a Line chart, with one line per Good/OK/Bad be a better visual indicator of trends over time?


Oct 10, 2025 7:14 AM in response to SGIII

Strangely, I didn't get notifications for your other reply. But there was confusion on the other thread, so I started a new one with a clear demonstration.


I see how this can be done, but I have a lot of data. I'll try copy/paste to see if I can make it work quickly.


"This is true in both Numbers and Excel. You can filter Pivot Tables, and remove Grand Total Rows and Columns, but you can't set the column order."


Actually, you can manually sort in Excel, which will probably my goto solution.


(I know people say this is not an Apple forum, but clearly people from Apple review posts here. Apple, you need to fix this.)


SGIII wrote:

Did you see my responses in your other thread?

How do I force sorting in a pivot table o… - Apple Community

Pivot Tables and Charts based on them are convenient for quick data analysis on the fly. But what you get in flexibility you give up in control over final presentation.

This is true in both Numbers and Excel. You can filter Pivot Tables, and remove Grand Total Rows and Columns, but you can't set the column order.

If you need a table and chart in a specific order that you can control, you can easily create a summary table by using SUMIFS, like this:


https://discussions.apple.com/content/attachment/c20c0aca-2aaa-4df5-b559-10eb25476df2


Note that you need to enter this formula just once, in B2. Then fill it or copy to the right and down in the summary table.

Then base your chart on that table instead of the Pivot Table. Note that you can now adjust the order of the columns in the Chart (if needed) by clicking on a series column in the chart and changing the value in the Order dropdown.


https://discussions.apple.com/content/attachment/fec68271-f5fe-462a-83f9-727287fb73c5


SG
[Edited by Moderator]


Oct 10, 2025 8:23 AM in response to G_Luv

G_Luv wrote:


Actually, you can
manually sort in Excel, which will probably my goto solution.


Excel is a good app. Use it if it works best for you. But I think you will find manual sort of columns is not an option in Pivot Tables. As with Numbers, you have a choice of ascending or descending (alphabetical order).




I can't tell whether you have even tried the one-formula SUMIFS approach, which easily solves the problem you describe as wanting to solve.


SG





Oct 10, 2025 8:27 AM in response to G_Luv

G_Luv wrote:

(I know people say this is not an Apple forum, but clearly people from Apple review posts here. Apple, you need to fix this.)

This is a user-to-user forum for people using Apple products and services. Apple Support, Apple engineers, Apple Developers don't read here for feedback or suggestions. The only Apple employees how have any sort of regular Apple presence here are the Hosts. They make sure we all obey the rules. They are the ones who edit posts that contravene the Terms of Use.


If you wan to leave feedback for Apple, you can do it here:


Product Feedback - Apple


Manual sorting of pivot table bars in Excel

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.