I often create tables in Excel where some cells contain a lot of text while others just contain a single digit or some other short value. With wrap text in cells enabled and then a combination of increasing row height and autofit the width of the columns there is a lot of wasted space in my sheets.
I would like a "smart" function that minimizes the unused white space. Does something like that exist? Or is there a algoritm that is simple enough to perform manually even on bigger sheets?
A few samples of what I mean:
A lot of wasted space horizontally
![](/board/proxy.php?image=http%3A%2F%2Fi.stack.imgur.com%2FR01PJ.png&hash=c8f9720cc8cf755c201f9ce2da6bd839)
Vertical wasted space
![](/board/proxy.php?image=http%3A%2F%2Fi.stack.imgur.com%2FtcRId.png&hash=6347566d624984c40ca88301143d1674)
This is probably pretty good
![](/board/proxy.php?image=http%3A%2F%2Fi.stack.imgur.com%2F3nTEy.png&hash=f98158705278995b530c98a42b24cd8b)
With merged cells it is starting to get complex as seen in this and the next example
![](/board/proxy.php?image=http%3A%2F%2Fi.stack.imgur.com%2F5p4Yk.png&hash=ab4e67359049c1d17e6af3f0f3a1df20)
Thinking a bit more about this I have realised that the algoritm I am looking for can't be too naive and could/need different optimising strategies:
I would like a "smart" function that minimizes the unused white space. Does something like that exist? Or is there a algoritm that is simple enough to perform manually even on bigger sheets?
A few samples of what I mean:
A lot of wasted space horizontally
![](/board/proxy.php?image=http%3A%2F%2Fi.stack.imgur.com%2FR01PJ.png&hash=c8f9720cc8cf755c201f9ce2da6bd839)
Vertical wasted space
![](/board/proxy.php?image=http%3A%2F%2Fi.stack.imgur.com%2FtcRId.png&hash=6347566d624984c40ca88301143d1674)
This is probably pretty good
![](/board/proxy.php?image=http%3A%2F%2Fi.stack.imgur.com%2F3nTEy.png&hash=f98158705278995b530c98a42b24cd8b)
With merged cells it is starting to get complex as seen in this and the next example
![](/board/proxy.php?image=http%3A%2F%2Fi.stack.imgur.com%2F5p4Yk.png&hash=ab4e67359049c1d17e6af3f0f3a1df20)
Thinking a bit more about this I have realised that the algoritm I am looking for can't be too naive and could/need different optimising strategies:
- Naive: In extreme cases it could end up making a cell with a lot of text very high, e.g., with just one letter or at least one word per line. Obviously that is not desirable.
- Usually I believe a squarish shape of the whole active area would be the most efficient. In that case optimising the circumference is probably the best strategy. However, if you want to print on a rectangular paper or view on a rectangular screen, it would make sense to sacrifice some optimisation to make sure that the data fits on one paper/screen.