+ Reply to Thread
Results 1 to 6 of 6

How do I add leading spaces to a value?

  1. #1
    Chris Brown
    Guest

    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. #2
    Niek Otten
    Guest

    Re: How do I add leading spaces to a value?

    Hi Chris,

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

    --
    Kind regards,

    Niek Otten

    "Chris Brown" <[email protected]> wrote in message
    news:[email protected]...
    >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. #3
    Ron Coderre
    Guest

    RE: 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. #4
    Guest

    Re: 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" <[email protected]> wrote in message
    news:[email protected]...
    >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




  5. #5
    CLR
    Guest

    RE: How do I add leading spaces to a value?

    =TEXT(A1,"??????????")

    Vaya con Dios,
    Chuck, CABGx3



    "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


  6. #6
    Chris Brown
    Guest

    RE: How do I add leading spaces to a value?

    THAT was it!! Thanks for the help - have a great w/e!

    "Ron Coderre" wrote:

    > 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


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1