Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Chris Brown
 
Posts: n/a
Default How do I add leading spaces to a value?

I have a list of values that vary in length, but I need to convert all of
them to 10 characters with spaces, not 0's as prefixes.

I have been able to use the text command to add 0's, but unable to add spaces.

Thanks in advance for any help!

-Chris
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Niek Otten
 
Posts: n/a
Default How do I add leading spaces to a value?

Hi Chris,

=REPT(" ",10-LEN(A1))&A1

--
Kind regards,

Niek Otten

"Chris Brown" wrote in message
...
I have a list of values that vary in length, but I need to convert all of
them to 10 characters with spaces, not 0's as prefixes.

I have been able to use the text command to add 0's, but unable to add
spaces.

Thanks in advance for any help!

-Chris



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Coderre
 
Posts: n/a
Default How do I add leading spaces to a value?

Try something like this:

For a value in A1
B1: =RIGHT(TEXT(A1," 0"),10)

Note: That format includes 10 spaces before the 0.

Does that help?

***********
Regards,
Ron

XL2002, WinXP-Pro


"Chris Brown" wrote:

I have a list of values that vary in length, but I need to convert all of
them to 10 characters with spaces, not 0's as prefixes.

I have been able to use the text command to add 0's, but unable to add spaces.

Thanks in advance for any help!

-Chris

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
 
Posts: n/a
Default How do I add leading spaces to a value?

Hi

Try something like this:
=REPT(" ",10-LEN(A2))&A2

Once done, you'll have to Copy the range and then Edit/Paste Special/Values
to fix the values.

Hope this helps.
Andy.

"Chris Brown" wrote in message
...
I have a list of values that vary in length, but I need to convert all of
them to 10 characters with spaces, not 0's as prefixes.

I have been able to use the text command to add 0's, but unable to add
spaces.

Thanks in advance for any help!

-Chris



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Remove leading space Karidre Excel Worksheet Functions 4 October 24th 05 03:39 PM
Strip leading spaces from cell Pete Excel Worksheet Functions 3 July 31st 05 02:26 AM
Stripping out imbedded spaces in a cell/row Tom Excel Worksheet Functions 8 April 22nd 05 03:49 PM
Remove Leading Spaces Kirk P. Excel Discussion (Misc queries) 3 March 3rd 05 01:30 PM
remove spaces in text in excel GnarlyCar Excel Discussion (Misc queries) 3 February 1st 05 05:02 PM


All times are GMT +1. The time now is 10:59 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"