+ Reply to Thread
Results 1 to 4 of 4

Converting Text Strings to specific number of characters

  1. #1
    Registered User
    Join Date
    04-27-2010
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    7

    Converting Text Strings to specific number of characters

    Hi there,

    I'm trying to set up an excel spreadsheet that will be converted to a notepad file which will be imported as a BACS file onto our banking system.

    The format for each line has to be identically structured, whereby starting positions for each field are the same. I'll then concatenate the cells to forms one cell which I can convert to notepad.

    For example the payee field has to have the same number of characters, so I want to somehow insert spaces before the text to make the cells 18 characters, the number of characters will vary on each line.

    I need to do a similar thing with the amounts, and convert an amount of say £100.00 to pence, but 11 characters long, so insert 0's at the front, e.g 00000010000.

    Is this possible?

    Any help would be greatly appreciated.

    Thanks

    D

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Converting Text Strings to specific number of characters

    My suggestion would be to have your raw data on one worksheet, then create another worksheet with formulas to format your data the way you want. You can save the second worksheet as a .txt file.

    Is your payee field guaranteed to be no longer than 18 characters? If so, the formula for the payee field would be
    Please Login or Register  to view this content.
    If it might be more than 18 characters you need
    Please Login or Register  to view this content.
    For the numeric field, I was not able to find any way to coax Excel to show a decimal number without the decimal point. Therefore for pounds you would have to convert to pence using this:
    Please Login or Register  to view this content.
    You could concatenate all this together into one massive formula, or you could create a third sheet that referred to the second
    Please Login or Register  to view this content.
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    04-27-2010
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Converting Text Strings to specific number of characters

    Great - thank you

  4. #4
    Registered User
    Join Date
    11-12-2012
    Location
    Zagreb
    MS-Off Ver
    Excel 2007
    Posts
    1

    Re: Converting Text Strings to specific number of characters

    Thank you sooo much, this tip saved me

+ 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