EXCEL - Remove a comma at the end of a cell

Solved
totodu0911 Posted messages 79 Status Member -  
totodu0911 Posted messages 79 Status Member -
Hello,
I have a problem getting my text file into my software because there are extra commas at the end of cells in Excel, and I would like to delete only the trailing comma and not the ones in between (see attached screenshot).

Is it possible to do this easily, or do I need to do it manually since I sometimes have 20,000 rows...?

Thank you in advance!

Théo

3 answers

  1. jee pee Posted messages 9445 Registration date   Status Moderator Last intervention   9 984
     
    Hello,

    We can remove the last character with a formula
    =MID(A1,1,LEN(A1)-1)

    If needed, we could have a formula that ensures it is a comma:
    =LEFT(A1,(FIND(",",A1,FIND(",",A1,1)+2)-1))


    0
  2. Mike-31 Posted messages 18405 Registration date   Status Contributor Last intervention   5 147
     
    Hello,

    or
    =LEFT(A2,LEN(A2)-1)

    however, if you have values without the comma at the end of the string, you should test it and complete the formula like this

    =IF(RIGHT(A2,1)=",",LEFT(A2,LEN(A2)-1),A2)

    --
    A+
    Mike-31

    I am responsible for what I say, not for what you understand...
    0
  3. totodu0911 Posted messages 79 Status Member 8
     
    Thank you both, you just saved me!
    0