+ Reply to Thread
Results 1 to 10 of 10

Substitutes specific character partly in cell

  1. #1
    Registered User
    Join Date
    01-13-2016
    Location
    München
    MS-Off Ver
    2013
    Posts
    19

    Substitutes specific character partly in cell

    Hej,
    I need your help please. I have data from a .csv file where unluckily the decimal and the thousand symbol are both ".". Therefore I would like to remove all "." except for the last one, which is the actual decimal-dot.

    As a formula I use: =IF((LEN(A1)-LEN(SUBSTITUTE(A1,".",""))>1),SUBSTITUTE(A1,".","",1),A1), but this only gives me the possibility to change the first ".". I would prefer to exchange all except for the last one. Also I would prefer to let it run as a macro, but there I'm stuck. I don't find a proper starting point. I think I need to count the amount of "." in each cell and if this amount is >1, I should replace them by "".

    But I don't know how to express it. Can somebody please help me?

    Thanks a lot!
    Greetings
    Moni
    Last edited by Blesbie; 06-05-2018 at 02:14 AM.

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Substitutes specific character partly in cell

    Try
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    01-13-2016
    Location
    München
    MS-Off Ver
    2013
    Posts
    19

    Re: Substitutes specific character partly in cell

    Thanks for the reply. Unfortunately I don't understand the code and it also doesn't do anything... It loads a bit, but the numbers stay the same. Maybe if you explain a bit, I would be able to find the error myself.

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Substitutes specific character partly in cell

    Then I need to see your workbook.

  5. #5
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Substitutes specific character partly in cell

    It would be nice to have some sample of the data, to prepare the macro properly
    - Battle without fear gives no glory - Just try

  6. #6
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Substitutes specific character partly in cell

    See next code
    Please Login or Register  to view this content.
    Last edited by PCI; 06-04-2018 at 01:30 PM.

  7. #7
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,528

    Re: Substitutes specific character partly in cell

    Try this on a copy of your workbook.
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    01-13-2016
    Location
    München
    MS-Off Ver
    2013
    Posts
    19

    Re: Substitutes specific character partly in cell

    Thanks so much at all of you. The codes of PCI and jolivanes work both :-) Since PCI does not even need an extra column, I will use that code, but thanks to all of you. You helped me really a lot :-)

  9. #9
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Substitutes specific character partly in cell

    Just for the fun a remake with a slight adjustment
    Please Login or Register  to view this content.
    Last edited by PCI; 06-05-2018 at 02:23 AM.

  10. #10
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,528

    Re: Substitutes specific character partly in cell

    Don't need an extra column.
    Please Login or Register  to view this content.

+ 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. [SOLVED] Specific character of a cell to display as specific number on another cell
    By excellenct in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-13-2015, 11:45 AM
  2. Remove Specific Character from Cell
    By maniacalmonkey in forum Excel General
    Replies: 3
    Last Post: 09-11-2014, 07:58 PM
  3. Returning a value if a cell contains a specific character
    By Jason24 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-25-2014, 11:30 AM
  4. [SOLVED] multiple substitutes in a certain cell
    By BROOF in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-14-2012, 10:55 AM
  5. [SOLVED] IF Cell.Value partly equals
    By jordan2322 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-17-2012, 01:23 AM
  6. Replies: 4
    Last Post: 09-06-2011, 10:36 AM
  7. Find Specific character in a Cell
    By CobraLAD in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-09-2009, 04: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