0

Is there a function/formula to return only the first string proceeding the first carriage return using Google Sheets?

Example Text:

Bob & Mary Smith   
[email protected]   
555-111-1234   

Assuming the above text is in cell A1, I would like the formula to return the following to Cell B1 "Bob & Mary Smith"

2 Answers 2

1

Generally speaking, this would do it:

=REGEXEXTRACT(A1,"(.+)\n")

0

Traditional way

=LEFT(A1,FIND(CHAR(10)) - 1)

OR

=LEFT(A1,FIND(CHAR(13)) - 1)
  • Use CHAR(10) for line feed (\n)
  • Use CHAR(13) for carriage return (\r\n )
2
  • 2
    that will always give an error. Did you mean =iferror( left(A1, find(char(10), A1) - 1), A1 )? Commented Apr 16, 2021 at 6:02
  • You are right. Thanks. Commented Apr 16, 2021 at 12:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.