+ Reply to Thread
Results 1 to 7 of 7

Keeping Excel from removing your zeroes...

  1. #1
    Registered User
    Join Date
    07-25-2011
    Location
    California, USA
    MS-Off Ver
    Excel 2010 PC
    Posts
    19

    Keeping Excel from removing your zeroes...

    One of the most annoying things about Excel is how it tries to be "helpful" by removing your trailing zeroes, even in a column formatted as Text. So I have a column that is text formatted that looks like this:

    1957.310_det1.jpg
    1957.310_det2.jpg
    1957.310_det3.jpg
    1957.310_det4.jpg
    1957.312
    1957.312_det1.jpg
    1957.312_det2.jpg
    1957.312_det3.jpg
    1957.312_det4.jpg
    1957.314
    1957.315
    1957.315_det1.jpg
    1957.315_det2.jpg
    1957.315_det3.jpg
    1957.315_det4.jpg
    1957.318
    1957.318_det1.jpg
    1957.318_det2.jpg
    1957.319
    1957.319_det1.jpg
    1957.319_det2.jpg
    1957.320
    1957.320_det2.jpg
    1957.320_det4.jpg

    I was trying to strip out the underscores and everything after them and then delete the duplicates. But if I just perform a replace of _*, then I get this result:

    1957.31
    1957.31
    1957.31
    1957.31
    1957.312
    1957.312
    1957.312
    1957.312
    1957.312
    1957.314
    1957.315
    1957.315
    1957.315
    1957.315
    1957.315
    1957.318
    1957.318
    1957.318
    1957.319
    1957.319
    1957.319
    1957.320
    1957.32
    1957.32

    ... which means I can't strip out the duplicates easily.

    Since the numbers are irregular, I can't tell excel that it should always have a certain number of training zeroes. Anyone have a handy solution for this?
    Last edited by Isara; 10-24-2012 at 07:49 PM. Reason: solved!

  2. #2
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: Keeping Excel from removing your zeroes...

    I applied a Number format with 3 decimal places on the whole range and then did the replace of _* and it seemed to work fine. Worth a try?

    - Moo

  3. #3
    Registered User
    Join Date
    07-25-2011
    Location
    California, USA
    MS-Off Ver
    Excel 2010 PC
    Posts
    19

    Re: Keeping Excel from removing your zeroes...

    That would work, except that it's not always three decimal places. Sometimes it looks like this:

    1959.7
    1959.7_det2.jpg
    1959.7_det9.jpg
    1959.7.tif
    1959.8_det.jpeg
    1959.8
    1960.1
    1960.10
    1960.104
    1960.105
    1960.105_det.jpg
    1960.11
    1960.12
    1960.12_det.jpg
    1960.13
    1960.13_det.jpg
    1960.16.a-b
    1960.3
    1960.4
    1960.4_det.jpg
    1960.45.a-b
    1960.55
    1960.58
    1960.58_det.jpg
    1960.59
    1960.59_det1.jpg
    1960.59_det2.jpg
    1960.60
    1960.68
    1960.7
    1960.7_det1.jpg
    1960.7_det2.jpg
    1960.7_det1.jpeg
    1960.7_det2.jpeg
    1960.78

    Wish I could

  4. #4
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: Keeping Excel from removing your zeroes...

    Ahh, well, that is a bit more complicated... your example didn't show that kind of stuff.

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: Keeping Excel from removing your zeroes...

    not sure if this is what you are looking for, but gibe it a try, copied down...

    =IF(ISERROR(SEARCH("_",H1,1)),H1,LEFT(H1,SEARCH("_",H1,1)-1))

    then in the next column over, use this, copied down

    =IF(COUNTIF($I$1:$I$21,I1)<2,"",I1)
    (adjust ranges as needed)
    Last edited by FDibbins; 10-24-2012 at 07:40 PM.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  6. #6
    Registered User
    Join Date
    07-25-2011
    Location
    California, USA
    MS-Off Ver
    Excel 2010 PC
    Posts
    19

    Re: Keeping Excel from removing your zeroes...

    The first formula worked like a charm! Thank you!!!

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: Keeping Excel from removing your zeroes...

    i thought 1 of your requirements was to remove duplicates? the 2nd formula would do that.

    either way, you'r welcome, and consider adding the reputation to those that helped (see points 2 & 3 below)

+ 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