+ Reply to Thread
Results 1 to 4 of 4

Inserting spaces between numbers and letters based on multiple conditions

  1. #1
    Registered User
    Join Date
    03-23-2012
    Location
    Chicago, Illinois
    MS-Off Ver
    Excel 2007
    Posts
    10

    Inserting spaces between numbers and letters based on multiple conditions

    Hey all,
    I'm trying to insert spaces between numbers and letters, but want to do so only with certain conditions in place. Each rule should be within its own formula, since the rules must follow a certain order to avoid any problems. Here are the rules in order:

    Let "A" represent all letters and "1" represent all numbers

    1. "AA1" -> "AA 1"
    2. "A1A" -> "A 1A"
    3. "1AA" -> "1 AA"
    4. "1A " -> preserve. IF "A" = "N", "S", "E", "W", then "1A " -> "1 A "

    Let me know if you can help me figure this one out.
    Thanks!!

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Inserting spaces between numbers and letters based on multiple conditions

    not sure what you mean for 4
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Registered User
    Join Date
    03-23-2012
    Location
    Chicago, Illinois
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Inserting spaces between numbers and letters based on multiple conditions

    Sorry about that. For clarification, "A" represents any letter and "1" represents any number. In a situation where the letter in the sequence "1A " is "N", "S", "E", W", change it to "1 A ". In situations where the letter is not "N", "S", "E", "W", leave the sequence "1A " unchanged.

    For example:
    "3C " -> "3C " (unchanged)
    "8W " -> "8 W " (changed)

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Inserting spaces between numbers and letters based on multiple conditions

    is there a space "3C " -> "3C " (unchanged)
    "8W " -> "8 W " (changed)
    could you give some full length examples of each its easier to see

+ 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