Sorry for raising an almost dead thread. I have this exact problem too, for a while now, and I desperately wish for a working solution.
I have the philosophy that it should be possible.
For me, when I have ranges with merged cells, I wish for those rows/columns that intersect the merged cell to stay together, considered as a single element for sorting. For example, if I have a sheet like this:
Code: Select all
--------+----------+-------
| Volume 1 | $2.34
+----------+-------
Comic 1 | Volume 2 | $2.99
+----------+-------
| Volume 3 | $2.99
--------+----------+-------
| Volume 1 | $2.99
Comic 2 +----------+-------
| Volume 2 | $4.10
--------+----------+-------
| Volume 1 |
+----------+-------
| Volume 2 | $3.14
Comic 3 +----------+-------
| Volume 3 | $4.00
+----------+-------
| Volume 3 | $4.10
--------+----------+-------
- If I try to sort by column A, it should keep rows 1-3, 4-5 and 6-9 as a single element and sort these three elements, keeping the relative location of the rows within the elements the same.
Even if, for example, cells B5 and B6 were to be merged before sorting, then all of rows 4-9 should be considered a single element.
- On the other hand, if I try to sort by column C, it should keep rows 1-3, 4-5 and 6-9 as a single group. There are two different behaviors that one might need:
- Only sort rows within each group. In this example, it should perform three separate sorts, as if I manually selected the rows of each group and initiated a separate sort.
- Sort the groups by the first representative element of each group, which in this case are rows 1, 4 and 7 (or by the concatenation of the cells, as if those cells were merged with the option 'move contents to the first cell').
This way, there wouldn't be a problem, right?
I need both A and B1 to keep my sheets organized (I can get A by not merging cells in Column A at all, and having lots of redundancy, but then I still don't have B1)
Is this possible (using scripts or whatever), and/or should I add this as a feature request?
Edit: made philosophy more consisten |