Excel’s JUSTIFY Command

Excel’s JUSTIFY Command

Excel’s JUSTIFY Command

By Bob Umlas, Excel MVP

Have you heard of the Justify command? Let’s take a look at it here.

Suppose you have the data below:

justify-1

and you’d like to make it look like this:

justify-2

You may not know that Excel has this ability already built-in! It’s called the Justify command, found on the right side of the Home tab:

justify-3

What this feature does is reflow text. To use it, you have to make a specific selection first. In the above example, the selection had to be A1:C3 or longer (A1:C4, A1:C100, etc.):

justify-4

From this selection, issuing the Justify command would reflow the text.

You could have selected just columns A and B and reissued the same command for this result:

justify-5

(The resulting selection, A1:A4, happens after the command is completed. The entire columns A:B were selected prior to using Justify.

It aligns with the column widths. Notice the difference with different column widths here (column B is wider, column C is pretty narrow), where A:C was selected:

justify-6

OK, here’s another trick: if you select A1:D3 and issue the justify command, you get this:

justify-7

It reflows text from 3 lines into 2 lines! If you had selected A1:G3, you’d see this:

justify-8

Pretty cool.

Let’s look at a new example. Say you have the data in column A, below, and you want to make it look like cell C1:

justify-9

If you select A1:J7, for example (remember, there’s nothing yet in C1) and issue the command, you’d see this:

justify-10

So here’s a trick to overcome that. In cell C1 we’ll enter a formula to both change A1 to text and insert a comma. That formula is =A1&”, “, and we fill down to C7:

justify-11

We have the makings of a solution, but we don’t want that ending comma in cell C7, so we change that formula to =A7&”” which appends an empty string but it’s now text:

justify-12

We’re not yet ready to use the Justify command because, if you read the message above, it also can’t contain formulas! So we have to copy C1:C7, then paste only the values back into the same place. Ctrl/C can copy, and we can use the Paste Special command to paste just the values:

justify-13justify-14

 

 

 

 

 

 

 

 

 

So this:

justify-15

becomes this:

justify-16
And we’re complete!

Learn more about IIL’s Microsoft Excel training >>

Bob Umlas has been voted an “MVP” (Most Valuable Professional) by Microsoft each year since 1994 for his contributions to Excel online forums and he is known world-wide for his expertise. As an MVP, he meets yearly with fellow MVPs at Microsoft’s headquarters in Redmond, where he has access to the product developers. He has also been a beta tester for new versions of Excel since version 1.5 and is the author of several books including This isn’t Excel, it’s Magic! (available on the IIL Bookstore), Excel Outside the Box, and More Excel Outside the Box.

 

 

 

 

Comments (2)

  • Tobi

    This was extremely helpful! Thank you. Is there a way to move column data to rows? EX: data in cells A1, B1, C1, D1 move to A1, A2, A3, A4

  • Lise

    just copy the cell and “paste special” and select transpose

Leave Comment