ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Packing characters (https://www.excelbanter.com/excel-worksheet-functions/111965-packing-characters.html)

Constantly Amazed

Packing characters
 
Hi

I have an exercises where I have a list of different names, of different
lengths but I want a result which packs out the name with trailing spaces so
that the final length of the name and spaces always equals 15 for each.

ie john needs 11 spaces added to it for the length to be 15 but andrew needs
9 spaces added.

Thanks

G

Roger Govier

Packing characters
 
Hi

Try
=(A1)&REPT(" ",15-LEN(A1))

--
Regards

Roger Govier


"Constantly Amazed" wrote
in message ...
Hi

I have an exercises where I have a list of different names, of
different
lengths but I want a result which packs out the name with trailing
spaces so
that the final length of the name and spaces always equals 15 for
each.

ie john needs 11 spaces added to it for the length to be 15 but andrew
needs
9 spaces added.

Thanks

G




Constantly Amazed

Packing characters
 
Hi Roger

Thanks that works just fine and has saved me a good deal of time.

G

"Roger Govier" wrote:

Hi

Try
=(A1)&REPT(" ",15-LEN(A1))

--
Regards

Roger Govier


"Constantly Amazed" wrote
in message ...
Hi

I have an exercises where I have a list of different names, of
different
lengths but I want a result which packs out the name with trailing
spaces so
that the final length of the name and spaces always equals 15 for
each.

ie john needs 11 spaces added to it for the length to be 15 but andrew
needs
9 spaces added.

Thanks

G





[email protected]

Packing characters
 
Hi,

Just append 15 blanks to your text and take leftmost 15 characters:
=LEFT(A1&REPT(" ",15),15)

HTH,
Bernd



All times are GMT +1. The time now is 05:52 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com