A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data
Hello Barry, I have uploaded the file to my Google Drive at
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I'm using MS 365 Excel desktop app, the latest version. I have duplicated the problem with a small spreadsheet. I have 4 rows of data; each row has Month (Col A) and Country (Col B), followed by 5 columns of stats. The rows are sorted by Month and then by Country. I want to create SUBTOTAL rows first for the Month and then for the Country. If I have just 4 columns of data the SUBTOTAL command works correctly and shows the subtotals in the correct order. If I have 5 columns of data, then the last SUBTOTAL rows are not in the correct position: the order should be Country subtotal, then Month Subtotal row, then the Grant Total. But, with 5 columns of stats, the rows are this order: Month Subtotal, Last Country subtotal, then Grand Total. I tried to include images of the formatting problem, but it appears MS doesn't like that and deleted my question immediately. So, I've rewritten the question with no pictures.
Thanks for your help,
Rick
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data
Hello Barry, I have uploaded the file to my Google Drive at
Dear @Rick Winford,
Thank you for reaching out to Microsoft Q&A forum.
I understand that you're having issues with the Subtotal function in Excel. As a forum moderator, I genuinely wish I could directly access your account or investigate the backend systems to diagnose and fix this for you. However, our role here is limited to providing general guidance and solutions that users can apply.
I tried to replicate your issue, but the Subtotal function works as expected on my end. Based on your description and my research, Excel’s Subtotal tool inserts summary rows using the SUBTOTAL function and creates an outline (grouping) structure. For nested subtotals (e.g., first by Month, then by Country within each Month), the order in which subtotals are applied is crucial. There have been documented behaviors over the years where grouping/outline levels get misapplied or the visual nesting appears inverted.
Please follow these steps exactly to see if it resolves the misplacement:
1.Sort the data correctly first (critical do this every time before subtotals):
2.Add the outer (Month) subtotal first:
3.Immediately add the inner (Country) subtotal:
4.Check the outline levels:
If the Subtotals Are Still Misplaced with 5 Columns:
Workaround 1: Subtotal one column at a time for the inner level:
Workaround 2: Use a PivotTable (recommended for reliability):
Workaround 3: Clear all subtotals and try again:
If none of the above solutions work, let me know in the comments for further investigation. Please note that our initial response does not always resolve the issue immediately. However, with your help and more detailed information, we can work together to find a solution. Thank you for your patience and understanding. I'm looking forward to your reply.
If the answer is helpful, please click "Accept Answer" and kindly upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
I have tried all of the suggestions listed in this answer and none of them resolve the problem,
thanks,
This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.
Comments have been turned off. Learn more
It seems you are experiencing an issue with the order of SUBTOTAL rows in your Excel spreadsheet when using five columns of data. This behavior can sometimes occur due to how Excel handles the SUBTOTAL function in conjunction with sorting and the number of columns involved.
Here are a few suggestions to troubleshoot and potentially resolve the issue:
If none of these solutions work, it may be beneficial to reach out to Microsoft support for further assistance, as they can provide more tailored help based on the specifics of your situation.
References: