Padding a word with spaces to fill a cell

Terry picture Terry · Mar 31, 2015 · Viewed 49.5k times · Source

Is it possible to pad a cell with spaces to ensure that it is the correct length?

Here's an example with * representing spaces.

Input    Output
-----    ------
red      red**
blue     blue*

The words are padded with spaces to ensure the cell content is 5 characters long.

Answer

zx8754 picture zx8754 · Mar 31, 2015

Try this:

=LEFT(A1&"*****",5)

We are adding lots of stars(*) then just cutting from left 5 characters.

enter image description here