Parse Before Line Break

J

Josh O.

I could use some help making a formula to return all characters before a
carriage return [or an alt-enter or Char (10), depending on how you referr to
it].

The Cell has a lot of text in it and can have more than 1 carriage return in
it...

Any ideas?
 
G

Glenn

Josh said:
I could use some help making a formula to return all characters before a
carriage return [or an alt-enter or Char (10), depending on how you referr to
it].

The Cell has a lot of text in it and can have more than 1 carriage return in
it...

Any ideas?


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

Rick Rothstein

If the text in A1 (or another cell if this formula is copied down) does not
have a Line Feed, your formula will error out. This is probably the simplest
fix to your formula for that possibility...

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

--
Rick (MVP - Excel)


Glenn said:
Josh said:
I could use some help making a formula to return all characters before a
carriage return [or an alt-enter or Char (10), depending on how you
referr to it].

The Cell has a lot of text in it and can have more than 1 carriage return
in it...

Any ideas?


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

Ashish Mathur

Hi,

You can also use Data > Text to columns. Select delimited and then click
Next. On the next screen, uncheck tab and check the "Other" box. In the
box next to Other, do the following

Alt+010 (on the numeric keypad)

--
Regards,

Ashish Mathur
Microsoft Excel MVP
www.ashishmathur.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top