Remove empty lines within a cell

Bonjour,
Do you know a formula to remove empty lines inside a cell in Excel?


(!) the number of non-empty lines is different in each cell

Thank you!

1 answer

  • Votes
  • Date
  • Descending date
  1. Hello,

    With:
    =SUBSTITUTE(A1,CHAR(10)&CHAR(10),CHAR(10)) 


    --
    Best regards
    Patrice
    1. Great!!! Thanks a lot!!!
      One small issue, when there is more than one empty line, the formula doesn't remove them all
      Can we change this in the formula?

    2. =SUBSTITUTE(SUBSTITUTE(A1,CHAR(10),CHAR(10)&CHAR(13)),CHAR(13)&CHAR(10),"")
    3. @Patrice33740Or rather:
      =SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1,CHAR(10),CHAR(10)&CHAR(13)),CHAR(13)&CHAR(10),"");CHAR(13),"")

      to clean the remaining carriage returns.