+ Reply to Thread
Results 1 to 5 of 5

Addresses - truncate 11 digit zip codes and leave 5 digit zip codes

  1. #1
    Registered User
    Join Date
    07-19-2013
    Location
    san diego
    MS-Off Ver
    Excel 2013
    Posts
    2

    Question Addresses - truncate 11 digit zip codes and leave 5 digit zip codes

    Hello all,

    I have a spreadsheet with 15000 addresses in a column and these addresses have both 5 digit and 11 digit zip codes. I would like a column with all 5 digit zip codes.

    I currently use the formula =LEFT(A1,LEN(A1)-6) to convert 11 digit zips into 5 digits but I would like a formula that first checks the length of the zip code before performing the function.

    Thank you for you time


    Zip Code Sample.xlsx

  2. #2
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Addresses - truncate 11 digit zip codes and leave 5 digit zip codes

    Please Login or Register  to view this content.
    basically
    if right 11 characters has has spaces then take whatever is in "A"
    otherwise use your left len formula
    Last edited by humdingaling; 07-25-2013 at 09:50 PM.
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Registered User
    Join Date
    07-19-2013
    Location
    san diego
    MS-Off Ver
    Excel 2013
    Posts
    2

    Re: Addresses - truncate 11 digit zip codes and leave 5 digit zip codes

    Incredibly quick response!!!!

    I greatly appreciate it.

  4. #4
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Addresses - truncate 11 digit zip codes and leave 5 digit zip codes

    not a problem


    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  5. #5
    Banned User!
    Join Date
    10-14-2006
    Posts
    1,211

    Re: Addresses - truncate 11 digit zip codes and leave 5 digit zip codes

    Another one, but slightly shorter

    =IF(COUNT(RIGHT(A2,11)),LEFT(A2,LEN(A2)-6),A2)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Working with 5-digit and 9-digit zip codes
    By WDP in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-14-2012, 10:54 AM
  2. Pulling 5-digit zip codes from fields
    By lthomas in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-28-2011, 10:56 AM
  3. Converting 9-digit zip codes to 5-digit zip codes
    By WDP in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-22-2009, 09:47 PM
  4. [SOLVED] Sorting by 5 digit & 5 digit plus 4 zip codes
    By D Marie in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-22-2006, 12:20 PM
  5. only 5 digit zip codes
    By sweet_tart08 in forum Excel General
    Replies: 1
    Last Post: 07-13-2005, 01:05 PM

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