How to search for newlines in a cell with the FIND function.(Microsoft Excel)
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)
=RIGHT(Text,LEN(Text)-FIND(CHAR(10), Text))
=RIGHT(A1,LEN(A1)-FIND(CHAR(10), A1))
---
Discussion
New Comments
No comments yet. Be the first one!