+ Reply to Thread
Results 1 to 6 of 6

Putting a space before a letter, after a number

  1. #1
    Registered User
    Join Date
    08-30-2010
    Location
    Rockhampton, Australia
    MS-Off Ver
    Excel 2010
    Posts
    3

    Putting a space before a letter, after a number

    Hi,
    I have a spreadsheet that’s about 20,000 rows ( ! ) and I need to alter the contents of one column. In column D there are cells filled with info like this:
    L42C2286
    L1RY26
    L4GH36
    L4444PH888

    And so on. What I need to do is put a space before the second letter (so after the L). So for example they would read:
    L42 C2286
    L4444 PH888

    Can anyone help me with this one? I don't even know if I'm posting this in the right section as I'm an Excel novice...

    [edited title, with apologies!]
    Last edited by Monkey106; 08-30-2010 at 11:14 PM.

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: Putting a space before a letter, after a number

    Hi Monkey, welcome to the forum.

    While this isn't elegant, it should work for you:

    Please Login or Register  to view this content.
    This is an array formula and must be confirmed with CTRL+SHIFT+ENTER, not just ENTER. To avoid 20,000+ array formulas, you may want to use VBA instead. If you want to go that route let us know.

  3. #3
    Registered User
    Join Date
    08-30-2010
    Location
    Rockhampton, Australia
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Putting a space before a letter, after a number

    Amazing - that works perfectly. Thank you so much for your help on this one, I would have never figured that out myself!

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: Putting a space before a letter, after a number

    Hi Monkey,
    Array Formulas are pretty daunting but so is VBA. Find attached a file that has a User Defined Function that will put a space in front of the second letter. It may be easier to use the VBA code than the Array Formula. Both are intermediate to advanced topics.
    Attached Files Attached Files

  5. #5
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,527

    Re: Putting a space before a letter, after a number

    And if you want to enter Marvin's formula for 20,000 rows with VBA
    Change column reference to suit.

    Please Login or Register  to view this content.
    Did not want to take away from your UDF Marvin but I thought it easier.
    John

  6. #6
    Registered User
    Join Date
    08-30-2010
    Location
    Rockhampton, Australia
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Putting a space before a letter, after a number

    Thanks guys - this was just a quick job for a client and it's been sent off so all is well! Much appreciated.

+ 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