+ Reply to Thread
Results 1 to 7 of 7

How can I shorten excess digits from zip codes in multiple cells?

  1. #1
    Registered User
    Join Date
    03-11-2016
    Location
    USA
    MS-Off Ver
    2013
    Posts
    12

    How can I shorten excess digits from zip codes in multiple cells?

    Hi there,

    I have a list with thousands of addresses. Some of them have these +4 zip codes, unfortunately no with a dash.
    It looks like this: Shreveport, LA 711096512
    Does anyone have an idea how to shorten these zip codes to only 5 digits or how to insert a dash after the 5th digit?

  2. #2
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: How can I shorten excess digits from zip codes in multiple cells?

    You have Excel 2013. Try Flash Fill. It's in the Data tab of the ribbon.

    With list in column A be sure to be in the next column over ... B.

    Just type in the first 5 digits of the first zip code, hit Flash Fill. You'll get a 'fly-out' icon prompting you to accept/undo.
    Dave

  3. #3
    Forum Expert
    Join Date
    11-26-2013
    Location
    Colac, Victoria, Australia
    MS-Off Ver
    Excel 2016
    Posts
    1,309

    Re: How can I shorten excess digits from zip codes in multiple cells?

    In Custom Formatting there is a Zip+4 option (under Special) which will insert the "-" after the fifth digit.
    (Right click on the cell(s), click Format Cells, Click Special)

    However, you said SOME. This will NOT work for those cells that are not 9 digits long. You may need to use the LEFT() formula. viz LEFT(A1,5) in cell B1 (where your zip code is in A1. This will work for all cells, returning the 5 digits of the ZIP code.

    I hope this helps, please let me know!

    Regards,

    David


    - Please click on the *Add Reputation button at the bottom of helpful responses.

    Please mark your thread as SOLVED:
    - Click Thread Tools above your first post, select "Mark your thread as Solved".


  4. #4
    Registered User
    Join Date
    03-11-2016
    Location
    USA
    MS-Off Ver
    2013
    Posts
    12

    Re: How can I shorten excess digits from zip codes in multiple cells?

    Thank you both for your answers.
    I already tried the LEFT formula but it didn't work for some reason.
    I'll try the flash fill tomorrow. Thanks again!

  5. #5
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: How can I shorten excess digits from zip codes in multiple cells?

    You're welcome and thanks for the feedback.

  6. #6
    Forum Expert
    Join Date
    11-26-2013
    Location
    Colac, Victoria, Australia
    MS-Off Ver
    Excel 2016
    Posts
    1,309

    Re: How can I shorten excess digits from zip codes in multiple cells?

    You're welcome bottledwater, but why didn't the LEFT formula work?

    I assumed that the ZIP Code was in a column by itself. Is the whole City, State and Zip in the one column?

    So if you have Shreveport, LA 711096512 in Cell A1, then =MID(A1,FIND(",",A1)+5,5) will extract the 5 digit code you want.

    I hope this helps, please let me know!

    Regards,

    David


    - Please click on the *Add Reputation button at the bottom of helpful responses.

    Please mark your thread as SOLVED:
    - Click Thread Tools above your first post, select "Mark your thread as Solved".


  7. #7
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: How can I shorten excess digits from zip codes in multiple cells?

    Does anyone have an idea how to shorten these zip codes to only 5 digits or how to insert a dash after the 5th digit?
    Edited As an afterthought I included TRIM.

    This does all the above. Try it in B1 as in below example.

    =TRIM(CHOOSE(((LEN(A1)-LOOKUP(25^25,--FIND(" ",A1,ROW($1:$50))))=9)+1,MID(A1,LOOKUP(25^25,--FIND(" ",A1,ROW($1:$50)))+1,99),REPLACE(MID(A1,LOOKUP(25^25,--FIND(" ",A1,ROW($1:$50)))+1,99),LEN(MID(A1,LOOKUP(25^25,--FIND(" ",A1,ROW($1:$50)))+1,99))-3,0,"-")))


    Row\Col
    A
    B
    1
    Shreveport, LA 711096512 71109-6512
    2
    Shreveport, LA 711096512 71109-6512
    3
    Shreveport, LA 711096512 71109-6512
    4
    Shreveport, LA 71109-6512 71109-6512
    5
    Shreveport, LA 711096512 71109-6512
    6
    Shreveport, LA 61920 61920
    7
    Shreveport, LA 711096512 71109-6512
    8
    Shreveport, LA 711096512 71109-6512
    9
    Shreveport, LA 618736512 61873-6512
    10
    Shreveport, LA 711096512 71109-6512
    11
    Shreveport, LA 711096512 71109-6512
    12
    Shreveport, LA 61832-6512 61832-6512
    13
    Shreveport, LA 711096512 71109-6512
    14
    Shreveport, LA 71109 71109
    15
    Shreveport, LA 711096512 71109-6512
    16
    Shreveport, LA 711096512 71109-6512
    17
    Shreveport, LA 711096512 71109-6512
    18
    Shreveport, LA 711096512 71109-6512
    19
    711096512
    #N/A
    20
    71109-6512
    #N/A
    21
    71109
    #N/A
    Last edited by FlameRetired; 05-24-2016 at 10:09 PM.

+ 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. Replies: 0
    Last Post: 03-09-2016, 06:38 PM
  2. Shorten digits in entire column?
    By jahagafut in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-13-2015, 11:54 AM
  3. Replies: 1
    Last Post: 12-10-2013, 12:28 AM
  4. how to shorten multiple IF statement
    By EgisD in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-21-2013, 05:56 AM
  5. Changing zip codes from plus 4 to just 5 digits
    By drjett in forum Excel General
    Replies: 5
    Last Post: 05-25-2012, 02:53 PM
  6. [SOLVED] How do I shorten 10-digit # so only 6 digits show up?
    By swingkittenva in forum Excel General
    Replies: 4
    Last Post: 01-07-2006, 04:10 AM
  7. [SOLVED] Removing Excess Digits From Cells
    By Raquel666 in forum Excel General
    Replies: 6
    Last Post: 02-18-2005, 10:06 AM

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