Bug 55640, added reproducer, a fix for the Exception cases and some verify-tests to ensure future changes are checked via unit tests. There might be more work pending to make grouping fully work the same way as Excel does.