Excel FIND and keep text after a character

I have in a cell names like :

XXX XXX"CHAR(10)"YYY YYY"CHAR(10)"ZZZ ZZZ

The lines in the cell are separated by CHAR(10), but I also have cell with just WWW WWW , so there is no CHAR(10) in that.

I am using a formula to delete everything after the first CHAR(10) and just keep the first line, but i need an upgrade to the formula to also copy the line if no CHAR(10) is found in the cell.

The formula so far is :

=LEFT(A1; FIND(CHAR(10);A1;1))

Thank you.

>Solution :

Try using

=LEFT(A1; FIND(CHAR(10);A1 & CHAR(10);1))

if you want to copy the whole cell if there is no Char(10).

Or you could use e.g. IFERROR.

Leave a Reply