+ Reply to Thread
Results 1 to 2 of 2

Cleaning a zip code using conditional formatting?or a formula?

  1. #1
    Registered User
    Join Date
    02-04-2013
    Location
    London, England
    MS-Off Ver
    Excel 2011, mac
    Posts
    45

    Cleaning a zip code using conditional formatting?or a formula?

    Hi all hope you can help

    I have a weird import sheet that I need to use monthly and its important that I fix the zip code field. Currently a zip code comes in like this '10012 or '10012-4004

    I need to clean the apostrophe out which is easy enough but if so do and some dont have the extra -4004 part (obviously the exact value can vary) how do I get the system to clean that part out also if it is there?


    Any help much appreciated.

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,025

    Re: Cleaning a zip code using conditional formatting?or a formula?

    Assuming data start in A2:

    =IFERROR(LEFT(A2,SEARCH("-",A2)-1),A2)

    copied down. If this isn't it... will you please attach a SMALL sample Excel workbook (10-20 rows of data is usually enough)? Please don't attach a picture of one (no-one will want to re-type all your stuff before starting). Unfortunately the attachment icon doesn't work at the moment. So, to attach an Excel file you have to do the following: Just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

+ 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: 6
    Last Post: 06-07-2016, 01:50 AM
  2. Cleaning up formatting Question
    By leviathan86 in forum Excel General
    Replies: 1
    Last Post: 04-30-2013, 04:54 PM
  3. Need help cleaning up already working code involving conditional shape fill
    By gorcorps in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-26-2012, 11:27 AM
  4. Conditional formatting by formula or VB code
    By Abhijit2011 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-18-2011, 07:47 AM
  5. Code needs cleaning up
    By hambone in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-09-2010, 10:51 AM
  6. Conditional Formatting Code - Deletes Wrong Conditional Format
    By RSpecianJr in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-29-2010, 10:53 AM
  7. Cleaning up VLOOKUP formula with possible matrix code
    By winnkys in forum Excel General
    Replies: 3
    Last Post: 01-15-2009, 11:43 PM

Tags for this Thread

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