Skip to main content

How to extract the first or last line from a multi-line cell in Excel?

If there are multi-line texts in a cell, now, you want to extract and copy the first or the last line text from the cell as following screenshot shown. How could you deal with this job quickly and easily in Excel?

Extract and copy the first line text from multi-line cells with formula

Extract and copy the last line text from multi-line cells with formula

Extract and copy each line text from multi-line cells with a powerful feature


Extract and copy the first line text from multi-line cells with formula

To copy and paste the first line text from the multi-line cell, please apply the below formula:

Enter this formula into a blank cell where you want to output the result:

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

And then, drag the fill handle down to the cells that you want to apply this formula, all first line text contents have been extracted at once, see screenshot:


Extract and copy the last line text from multi-line cells with formula

If you want to extract the last line text from the cell, please apply the following formula:

Enter or copy the below formula into a blank cell:

=TRIM(RIGHT(SUBSTITUTE(A2,CHAR(10),REPT(" ",200)),200))

And then, drag the fill handle down to the cells that you want to apply this formula, all last line text contents have been extracted as following screenshot shown:


Extract and copy each line text from multi-line cells with a powerful feature

Here, you can also extract each line text from the multi-line cells into separate cells. Kutools for Excel’s Split Cells feature can help you to solve this task as quickly as possible.

Tips:To apply this Split Cells feature, firstly, you should download the Kutools for Excel, and then apply the feature quickly and easily.

After installing Kutools for Excel, please do as this:

1. Select the range of cells that you want to use, and then click Kutools > Merge & Split > Split Cells, see screenshot:

doc extract first line 04

2. In the Split Cells dialog box, select Split to Columns from the Type section, and then choose New line from the Split by section, see screenshot:

3. Then, click Ok button, and in the following prompt box, select a cell to output the result, see screenshot:

4. And then, click OK button, and each line text has been extracted to separate cells as below screenshot shown:

Click to Download Kutools for Excel and free trial Now!


More relative extract words or characters articles:

  • Extract First Two Or N Words From Text String
  • If you have a list of text strings which are separated by space, and now, you want to extract first three or n words from the cell value to get the following screenshot result. This article, I will introduce some formulas to extract first two or n words from text string in Excel.
  • Extract First / Last / Nth Word From Text String In Excel
  • Have you ever suffered with the problem that you need to extract a certain word from the text string in a worksheet? For example, you have the following range of text strings needed to get the first/last or nth word from them, here I can talk about some effective ways for you to solve it.
  • Extract Last Number From Text String In Excel
  • Supposing, you have a list of text strings which mixed with texts and numbers, now, you need to extract the last set of numbers as following screenshot shown. How could you handle this job in Excel?

  • Super Formula Bar (easily edit multiple lines of text and formula); Reading Layout (easily read and edit large numbers of cells); Paste to Filtered Range...
  • Merge Cells/Rows/Columns and Keeping Data; Split Cells Content; Combine Duplicate Rows and Sum/Average... Prevent Duplicate Cells; Compare Ranges...
  • Select Duplicate or Unique Rows; Select Blank Rows (all cells are empty); Super Find and Fuzzy Find in Many Workbooks; Random Select...
  • Exact Copy Multiple Cells without changing formula reference; Auto Create References to Multiple Sheets; Insert Bullets, Check Boxes and more...
  • Favorite and Quickly Insert Formulas, Ranges, Charts and Pictures; Encrypt Cells with password; Create Mailing List and send emails...
  • Extract Text, Add Text, Remove by Position, Remove Space; Create and Print Paging Subtotals; Convert Between Cells Content and Comments...
  • Super Filter (save and apply filter schemes to other sheets); Advanced Sort by month/week/day, frequency and more; Special Filter by bold, italic...
  • Combine Workbooks and WorkSheets; Merge Tables based on key columns; Split Data into Multiple Sheets; Batch Convert xls, xlsx and PDF...
  • Pivot Table Grouping by week number, day of week and more... Show Unlocked, Locked Cells by different colors; Highlight Cells That Have Formula/Name...
kte tab 201905
  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
officetab bottom
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