Results 1 to 2 of 2

Adding spaces to text data in a cell

Threaded View

  1. #2
    Valued Forum Contributor
    Join Date
    10-17-2010
    Location
    Nottingham, England
    MS-Off Ver
    Excel 2003, 2007, 2010, 2013, 2016, 2019, 365
    Posts
    294

    Re: Adding spaces to text data in a cell

    The only way you can add spaces automatically is to define a set of rules, then write formulae to implement those rules. If you think about the mental rules you're applying in the 3 examples you list, they are roughly
    a) to put a space in if:
    1. numbers change to letters
    2. you recognise a distinct word (NW, Main, St, Winding, Ridge, Rd, N - and the rules for recognising the words are quite complex, e.g. not every n should be converted into N for North)
    b) to capitalise
    3. First letter of most words
    4. Whole of compass points

    Writing formulate for 3 is fairly straightforward, but 1, 2 and 4 are rather more difficult! 2, especially, requires referencing a lot of possible words!

    I'm afraid that, unless you can come up with some more straightforward rules, you can't do the lot with formulae. You could get some way, by putting spaces around 'St' and 'Rd', but you'd still run into problems with words containing either or both of these letter pairs, e.g. 'stardust'.

    Unless you've got thousands of rows, I'm afraid it might be easiest to do it manually...
    Last edited by outofthehat; 06-16-2011 at 04:53 AM. Reason: Decided 1 isn't staightforward, either...

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