+ Reply to Thread
Results 1 to 7 of 7

Custom Format

  1. #1
    Registered User
    Join Date
    08-01-2008
    Location
    Reading, England
    MS-Off Ver
    Office 2003
    Posts
    17

    Custom Format

    I apologise in advance if I am duplicating a thread, but haven't been able to find a solution on the forum.

    My question if anyone can help;

    Within a work sheet I am analysing UK postcode. On the first sheet, the postcode is entered in its entire format ie. AB12 1CD, however on the 2nd sheet, I would like it to copy the 1st sheet but only printing the 1st part ie. AB12

    Is there such function that will help me with this?

  2. #2
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,454

    Re: Custom Format

    You could use a formula to extract the first half of he postcode:

    =LEFT(A1,LEN(A1)-3)
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  3. #3
    Valued Forum Contributor squiggler47's Avatar
    Join Date
    02-17-2009
    Location
    Littleborough, UK
    MS-Off Ver
    Excel 3.0 to 2007+2010! (couldnt get 2.1 working)
    Posts
    1,013

    Re: Custom Format

    This is another variation

    =LEFT(P3,FIND(" ",P3)-1)

    or

    =IF(ISERROR(FIND(" ",P4)),P4,LEFT(P4,FIND(" ",P4)-1))

    the second just returns the full post code if there is no space in it in cases of a partial post code!
    Regards
    Darren

    Update 12-Nov-2010 Still job hunting!

    If you are happy with the results, please add to our reputation by clicking the blue scales icon in the blue bar of the post.

    Learn something new each day, Embrace change do not fear it, evolve and do not become extinct!


  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Custom Format

    squiggler, you can avoid the need for the Error check by appending the string within the FIND, ie:

    =LEFT(P3,FIND(" ",P3&" ")-1)

  5. #5
    Valued Forum Contributor squiggler47's Avatar
    Join Date
    02-17-2009
    Location
    Littleborough, UK
    MS-Off Ver
    Excel 3.0 to 2007+2010! (couldnt get 2.1 working)
    Posts
    1,013

    Re: Custom Format

    True!

    Still I've got an excuse I only just made my morning coffee!

  6. #6
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Custom Format

    Wasn't having a "go"

    Just showing the approach - I always used to use the Error check approach until it was pointed out to me by Richard Schollar, sometimes (read most of the time) the most obvious workarounds are the ones we miss !!

  7. #7
    Valued Forum Contributor squiggler47's Avatar
    Join Date
    02-17-2009
    Location
    Littleborough, UK
    MS-Off Ver
    Excel 3.0 to 2007+2010! (couldnt get 2.1 working)
    Posts
    1,013

    Re: Custom Format

    Still the ISERROR aproach has an advantage

    You can change the P4 to "" or "Invalid" depending on what is needed!

+ 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