+ Reply to Thread
Results 1 to 18 of 18

Quick way to show only numeric in a cell?

  1. #1
    Registered User
    Join Date
    07-06-2009
    Location
    Wayne, NE
    MS-Off Ver
    Excel 2007
    Posts
    19

    Quick way to show only numeric in a cell?

    I am almost done with the school thing I've been working on and I just need to clean up one more thing. The zip code column can be a little sloppy sometimes. Many of them are perfect, but many carry a little too much over from where I am pulling it, so the states name is in there. Is there anyway I can filter it or something without losing any of my rows so that it only shows the numeric stuff in that column.
    Example:
    SD, 57401

    Need:

    57401

    Also, some have hyphens like 1324-56789. So I don't know how to say only numeric but include hyphenated numbers either.

    Thanks for all the help.
    Last edited by Joe@WSC; 07-08-2009 at 11:34 AM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Quick way to show only numeric in a cell?

    So if it is hyphenated, you do want the whole hyphenated number?
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    07-06-2009
    Location
    Wayne, NE
    MS-Off Ver
    Excel 2007
    Posts
    19

    Re: Quick way to show only numeric in a cell?

    Yeah it needs to show the zip code, whether it is the 5 digit or the 4-5 digit style.....actually, I'd probably be able to get away with just the 5 digit code. So could we just say only show 5 characters from the right or something like that?

  4. #4
    Registered User
    Join Date
    07-06-2009
    Location
    Wayne, NE
    MS-Off Ver
    Excel 2007
    Posts
    19

    Re: Quick way to show only numeric in a cell?

    Never mind, the zip code is 5-4 not 4-5 so that idea I had wouldn't work. I did find something to filter out the SD's though, there is a does not contain thing under filter so that worked. Now I just need to figure out how to deal with the longer zip codes getting cut off.

  5. #5
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Quick way to show only numeric in a cell?

    Would something like this work...

    In a new column, add formula:

    =IF(ISNUMBER(SUBSTITUTE(A1,"-","")+0),A1,RIGHT(A1,5))

    where A1 is 1st cell to purge...

    copy formula down.

    To replace originals, copy the new column and Edit|Paste Special >> Values over the old.. then delete the new.

  6. #6
    Registered User
    Join Date
    07-06-2009
    Location
    Wayne, NE
    MS-Off Ver
    Excel 2007
    Posts
    19

    Re: Quick way to show only numeric in a cell?

    Sorry, didn't really work. I don't know if I am explaining it very well and I don't think I am allowed to post an example because of what I am working on. I am pulling the zip code out of another column that has city state and zip. That is why the zip code column has some extra info sometimes. The original problem was that it doesn't move over as clean as the city column I extracted from the same original column. Sometimes it cuts the zip off, sometimes it moves the state over with it. All I really want now is the 5 digit normal zip code to move over, but it is hard because not all zip codes were formatted the same way. Thanks for your help so far and if you have any more ideas I am grateful for them.

  7. #7
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Quick way to show only numeric in a cell?

    You would need to post a sample sheet using "fake data" that is organized/formatted the same way...so that we get an idea of what you are up against....

    and show what you want the outcome to look like.

  8. #8
    Registered User
    Join Date
    07-06-2009
    Location
    Wayne, NE
    MS-Off Ver
    Excel 2007
    Posts
    19

    Re: Quick way to show only numeric in a cell?

    Ok, I will whip something up quick.

  9. #9
    Registered User
    Join Date
    07-06-2009
    Location
    Wayne, NE
    MS-Off Ver
    Excel 2007
    Posts
    19

    Re: Quick way to show only numeric in a cell?

    It says I don't have am missing a security token when I try to add the attachment. It is saved as an xlsx which is an ok file type right?

  10. #10
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Quick way to show only numeric in a cell?

    It should be ok as long as it is not over 1000kb in size.. or you can try zipping it...

    as far as the security is concerned.. not sure what that means...

    try again, using the paperclip icon, browse, upload..... if it still gives trouble I will report to Admin.

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

    Re: Quick way to show only numeric in a cell?

    If the ZIP is always at the end of the string then perhaps:

    =RIGHT(" "&A1,5+(5*(MID(" "&A1,LEN(" "&A1)-4,1)="-")))

  12. #12
    Registered User
    Join Date
    07-06-2009
    Location
    Wayne, NE
    MS-Off Ver
    Excel 2007
    Posts
    19

    Re: Quick way to show only numeric in a cell?

    Sorry, I don't know how to delete messages, but this one should be deleted.
    Last edited by Joe@WSC; 07-08-2009 at 10:49 AM.

  13. #13
    Registered User
    Join Date
    07-06-2009
    Location
    Wayne, NE
    MS-Off Ver
    Excel 2007
    Posts
    19

    Re: Quick way to show only numeric in a cell?

    Ok, here we go. A B and C are input. The rest is the clean and separated output we want, but as you can see the zip column is not so clean. I filtered the extra rows out to hide the mess, but they are there for referencing. In the end I want to move the outputs to a separate file so I can export that to a program.
    Attached Files Attached Files

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

    Re: Quick way to show only numeric in a cell?

    I'm sorry to say I can't really make sense of the file... if we insert new columns between C & D so that you have a new blank column in D... then

    D1: =IF(ISERR(--RIGHT(B1,4)),"",RIGHT(" "&B1,5+(5*(MID(" "&B1,LEN(" "&B1)-4,1)="-"))))
    copied down

    should generate

    54321 in row 6
    67890-1234 in row 8
    67854 in row 10
    34567 in row 12

    all other rows should return blank given there is seemingly no zip code to retrieve.

  15. #15
    Registered User
    Join Date
    07-06-2009
    Location
    Wayne, NE
    MS-Off Ver
    Excel 2007
    Posts
    19

    Re: Quick way to show only numeric in a cell?

    Sorry if it was confusing. But would your formula work on a file that is thousands of schools long. Or would I have to go through and change each one to match the zip codes.

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

    Re: Quick way to show only numeric in a cell?

    I'm afraid I don't understand the question ...

    The formula provided would pull a Zip if it appears at the end of the string and follows one of 2 patterns:

    ##### or #####-####

  17. #17
    Registered User
    Join Date
    07-06-2009
    Location
    Wayne, NE
    MS-Off Ver
    Excel 2007
    Posts
    19

    Re: Quick way to show only numeric in a cell?

    Sorry, I just didn't follow along with the formula, but it seems to be working the way I want it now. Thanks for all the help and have a good day.

  18. #18
    Registered User
    Join Date
    07-06-2009
    Location
    Wayne, NE
    MS-Off Ver
    Excel 2007
    Posts
    19

    Re: Quick way to show only numeric in a cell?

    Actually, that formula is amazing. It works perfectly. You are an excel genius.

+ 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