Link to home
Start Free TrialLog in
Avatar of cebu1014
cebu1014

asked on

Text function for trailing spaces

If I have a  cell that contains something less than 12 characters , how can I get spaces added on end where total length is 12 characters in field?
SOLUTION
Avatar of Shanan212
Shanan212
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Avatar of Patrick Matthews
Patrick Matthews
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I see what you did there! :)
cebu1014,

Please note that my formula might mishandle entries that are already >12 characters long.  For example, if the original entry is 17 characters long, my formula will truncate at the 12th character, while Shanan212's formula will return all 17 characters (and not add any trailing spaces).

Only you know whether or not there would ever be any initial data with >12 characters, and what should happen in that event.

:)

Patrick
Avatar of cebu1014
cebu1014

ASKER

It will be 12 characters max. Never longer.