Extract First or Last N Characters

This post will guide you how to extract the first or last n characters from a text string in one cell in Excel. How do I get the first or last N characters from a string using an Excel formula. How to extract first two or last two characters of a cell with a formula in Excel.

Extract First N Characters


If you want to extract the first n characters of a sting in a cell in Excel, you can use the LEFT function to create a formula to achieve it. For example, you want to extract the first two characters from a text string in Cell B1, just using the following formula:

=LEFT(B1,2)

extract first two character1

Type this formula into a blank cell, and then press Enter key in your keyboard.

The First two characters are extracted in Cell C1.

 Extract Last N Characters


To extract the last N characters in a cell in excel, you need to use the RIGHT function to achieve it. For examples, you want to extract the last two characters from a text string in cell B1, just using the below formula:

=RIGHT(B1,2)

extract first two character2

Type this formula into a blank cell, and then press Enter key.

The last two characters are extracted in Cell C1.

Related Functions


  • Excel LEFT function
    The Excel LEFT function returns a substring (a specified number of the characters) from a text string, starting from the leftmost character.The LEFT function is a build-in function in Microsoft Excel and it is categorized as a Text Function.The syntax of the LEFT function is as below:= LEFT(text,[num_chars])…
  • Excel RIGHT function
    The Excel RIGHT function returns a substring (a specified number of the characters) from a text string, starting from the rightmost character.The syntax of the RIGHT function is as below:= RIGHT (text,[num_chars])…
Related Posts

Extract substring In Excel

This post will guide you how to use Excel's MID function is a quick and easy way to extract pieces from your text. Use the Excel formula to extract a substring with MID. Note: If you want to extract just ...

How to Split Cells by the First Space in Texts in Excel

Sometimes we may use space to separate texts to different groups in one cell, if we want to split this cell to multiple columns refer to space, we can implement this via ‘Text to Columns’ feature. But is there any ...

How to Convert Uppercase to Lowercase Except the First Letter in Excel

In excel, words can be entered in uppercase, lowercase or mixed. If we want to convert all uppercase to lowercase (except the first letter in some situations), we can use formula with some letter convert related functions to convert them ...

How to Convert Text to Time in Excel

This post will guide you how to convert time string to time in Excel. Assuming that you have a list of text string in your worksheet, and you wish to convert these time string to standard time format, how to ...

How to Remove Last or Trailing Commas in Excel

This post will guide you how to remove trailing commas from cell in Excel. How do I remove comma character at the end of a cell with a formula in Excel 2013/2016. Remove Trailing Commas if you want to remove ...

Sidebar