Share via

MS Excel SUBTOTAL rows are in the wrong order.

Rick Winford 0 Reputation points
2026-02-16T17:02:45.07+00:00

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

Microsoft 365 and Office | Excel | For business | Windows
0 comments No comments

6 answers

Sort by: Most helpful
  1. Rick Winford 0 Reputation points
    2026-02-17T05:15:33.8966667+00:00

    Hi Barry, thank you for your response, but I did not manually insert any row. I have gone through the steps multiple times with the same outcome and I have never moved or inserted any row. When I first found this problem it was on a bigger spreadsheet where I use a VBA macro that I wrote to automate this process. I spent several hours recreating the problem with a very small dataset. I find it interesting that it works correctly with 4 columns of data for each month but then breaks with 5.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.