How to search for newlines in a cell with the FIND function.(Microsoft Excel)

Japanese version.

Here we show how to get the position of a newline in a cell with the FIND function.

Steps.

To represent a newline in a cell as a string, use the CHAR function and set it to CHAR(10).

=FIND(CHAR(10),Text)
=FIND(CHAR(10),A1)

This and the LEFT, RIGHT, and LEN functions can also be used to obtain the before and after line breaks.

=LEFT(Text,FIND(CHAR(10), Text)-1)
=LEFT(A1,FIND(CHAR(10), A1)-1)
Before line break.
=RIGHT(Text,LEN(Text)-FIND(CHAR(10), Text))
=RIGHT(A1,LEN(A1)-FIND(CHAR(10), A1))
After line break.

---

Links

Tips. Others.(Microsoft Excel)