Skip to main content

Excel Formula: Extract first line of cell

In sometimes, there are several lines of contents in one Excel cell, if you just want to extract first line of contents into another cell, you can use a formula combined with LEFT function and SEARCH function.
doc extract first line 1

Generic formula:

LEFT(txt, SEARCH(CHAR(10), txt)-1)

Arguments

Txt: the cell contents you want to extract first line from.

Remark

If there is blank or no char(10)(line break) in the text, it returns error value #VALUE!.

How this formula work

To extract first line from cell C3, please use below formula:

=LEFT(C3, SEARCH(CHAR(10), C3)-1)

Press Enter key.
doc extract first line 2

Explanation

CHAR(10): the line break.

SEARCH function finds the starting position of a character or text string in a given text. Here the formula SEARCH(CHAR(10), C3) finds the starting position of CHAR, returns 8.

LEFT function extracts text from left side of a text based on the given position. The formula =LEFT(C3, SEARCH(CHAR(10), C3)-1) can be seen as =LEFT(C3, 8-1), extracts 7 characters from left side of cell C3, returns “Combine”.

Sample File

doc sampleClick to download sample file


Relative Formulas


Relative Functions

  • LEFT function
    Extract text from left side.
  • SEARCH function
    Find a string within another string, and returns the starting position of the string inside another one.
  • IF function
    Test for conditions.
  • MID function
    Extract part of text from a cell value based on the location and length.

The Best Office Productivity Tools

Kutools for Excel - Helps You To Stand Out From Crowd

🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions
Popular Features: Find, Highlight or Identify Duplicates  |  Delete Blank Rows  |  Combine Columns or Cells without Losing Data  |  Round without Formula ...
Super VLookup: Multiple Criteria  |  Multiple Value  |  Across Multi-Sheets  |  Fuzzy Lookup...
Adv. Drop-down List: Easy Drop Down List  |  Dependent Drop Down List  |  Multi-select Drop Down List...
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  Compare Columns to Select Same & Different Cells ...
Featured Features: Grid Focus  |  Design View  |  Big Formula Bar  |  Workbook & Sheet Manager | Resource Library (Auto Text)  |  Date Picker  |  Combine Worksheets  |  Encrypt/Decrypt Cells  |  Send Emails by List  |  Super Filter  |  Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters ...)  |  50+ Chart Types (Gantt Chart ...)  |  40+ Practical Formulas (Calculate age based on birthday ...)  |  19 Insertion Tools (Insert QR Code, Insert Picture from Path ...)  |  12 Conversion Tools (Numbers to Words, Currency Conversion ...)  |  7 Merge & Split Tools (Advanced Combine Rows, Split Excel Cells ...)  |  ... and more

Kutools for Excel Boasts Over 300 Features, Ensuring That What You Need is Just A Click Away...

Description


Office Tab - Enable Tabbed Reading and Editing in Microsoft Office (include Excel)

  • One second to switch between dozens of open documents!
  • Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
  • Increases your productivity by 50% when viewing and editing multiple documents.
  • Brings Efficient Tabs to Office (include Excel), Just Like Chrome, Edge and Firefox.
Comments (0)
No ratings yet. Be the first to rate!
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations