Using the JUSTIFY Command: Reflow Text in Microsoft Excel

Reflow text in Microsoft Excel with the JUSTIFY command.

Learn how to use the built-in Justify command in Excel to reflow and arrange your text, with examples and step by step instructions.

Suppose you have this data:


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


Many people are unaware that Excel has this ability already built-in! It’s the Justify command, found on the right side of the Home tab:

Excel Bootcamp: Live & Hands-on, In NYC or Online, Learn From Experts, Free Retake, Small Class Sizes,  1-on-1 Bonus Training. Named a Top Bootcamp by Forbes, Fortune, & Time Out. Noble Desktop. Learn More.


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.):

Screenshot of an Excel spreadsheet with cells A1 through C5 selected. Cell A1 contains the text, 'Now is the time for all good men to come to the aid of their party.'

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

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


(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:


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


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


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:


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

Screenshot of an Excel worksheet with multiple numeric cells selected. A pop-up dialog displays the error message: 'Cannot justify cells containing numbers or formulas.'

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:


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:


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 just the values back into the same place. Ctrl/C can copy, and we can use the Paste Special command to paste just the values:



So this:


Becomes this when you use the justify command:

Screenshot of an Excel worksheet row where cell C displays '123456, 33,' followed by other cells containing multiple numeric values (827382, 91872, 12421, 3312, 188) in adjacent columns.

And we’re complete!

photo of Bob Umlas

Bob Umlas

Bob Umlas is an instructor who has been using Microsoft Excel since version 0.99 in 1986. Bob has been awarded a Microsoft MVP Award for 25 years running. He is the author of 5 Excel books and has been the Technical Editor for many of Bill Jelen's ("Mr. Excel") books. Bob is an Excel and VBA instructor at NYC Career Centers, a Noble Desktop partner company. He conducts online Excel training and consulting and writing articles on Excel tips & tricks and techniques. 

More articles by Bob Umlas

How to Learn Excel

Master Excel with hands-on training. Excel is the leading spreadsheet application used by over 750 million people worldwide.

Yelp Facebook LinkedIn YouTube Twitter Instagram