Inside The Web
    Facebook Twitter Instagram
    Inside The Web
    • Office
      • Excel
      • Ms Word
      • OneDrive
      • Google Docs
      • Google Sheets
      • Google Drive
    • Email
      • Gmail
      • Outlook
      • Emal Etiquette
    • Office Etiquette
    • Productivity
    Inside The Web
    Home»Office»Excel»How to Extract Text From a Cell in Excel

    How to Extract Text From a Cell in Excel

    Asmi DhakalBy Asmi DhakalNovember 24, 2023 Excel 5 Mins Read

    Sometimes when pasting data from the web, our values come accompanied by special characters. Other times, they crowd up a single cell.

    In both cases, you can choose from a range of Excel functions to extract text from a cell.

    Excel has three dedicated functions to pull such substrings—LEFT, RIGHT, and MID. While these functions are usually enough, you will need to nest a few additional functions for more complex extractions.

    Extract Text from the Left

    Function UsedTypeSyntax
    LEFTTEXT=LEFT(text, [num_chars])

    As the name suggests, the LEFT function in Excel is used to extract text from the left. The function will extract the exact number of characters you specify in the ‘num_chars’ section of the formula.

    We have the student ID of 10 students in column A.

    The first three texts from the cell specify the batch of these students. Let’s use the LEFT function to extract the batch of all 10 students.

    In cell D2, enter the following formula:

    =LEFT(A2,3) // Extracts three characters from the left of A2.
    LEFT function Excel

    Then, use flash fill to apply the formula to the entire range.

    Extract Text from the Right

    Function UsedTypeSyntax
    RIGHTTEXT=RIGHT(text,[num_chars])

    The RIGHT function is used to extract text from the right. You must enter the number of characters you wish to extract from the right in the ‘num_chars’ section of the argument.

    Column A contains the serial number of 10 delegates.

    Excel Table

    The last two characters of the ID contain the delegate’s name initials. Here’s how we will be using the RIGHT function to extract the initials:

    =RIGHT(A2,2) // Extracts two characters from the right of A2.
    RIGHT function

    Apply the formula to the entire range.

    Extract Text from a Specific Location

    Function UsedTypeSyntax
    MIDTEXT=MID(text,start_num,num_chars)

    Say, you don’t want to extract substrings from either left or right but the middle. In such a case, use the MID function.

    In MID, you must specify the position of the substring you wish to extract in the ‘start_num’ section. Then, the number of characters you want MID to extract in the ‘num_chars’ section.

    The sheet below holds a list of code names in column A.

    Excel Data Table

    We’ve been assigned to clean the data by excluding the first and last three characters from the string. In cell G2, here’s how we constructed a formula using the MID function:

    =MID(A2,4,5) // Extracts five characters from the fourth position of A2.
    MID function to extract five characters

    Use Flash Fill to paste the formula to the entire range.

    Extract Text from Numbers

    Function UsedTypeSyntax
    TEXTJOINTEXT=TEXTJOIN(delimiter,ignore_empty,text1…)
    IFLOGICAL=IF(logical_test,[value_if_true],[value_if_false])
    ISERRORBOOLEAN=ISERROR(value)
    MIDTEXT=MID(text,start_num,num_chars)
    SEQUENCEDYNAMIC ARRAY=SEQUENCE(rows,[columns],[start],[step])
    LENINTEGER=LEN(text)

    You may find the need to only extract texts in alphanumeric characters. For such scenarios, you will have to use the TEXTJOIN, IF, ISERROR, MID, and SEQUENCE functions to construct a formula.

    Column D holds 10 addresses. Some of these addresses include postal codes which, we’re looking to remove.

    Data set in Excel

    Here’s how we constructed a formula to remove such numbers from our final address:

    =TEXTJOIN("", TRUE, IF(ISERROR(MID(D2, SEQUENCE(LEN(D2)), 1)*1), MID(D2, SEQUENCE(LEN(D2)),1),"")) // Joins characters that ISERROR returned TRUE for.
    Address extracted from MID

    We’ve covered an entire article on How to Remove Numbers from Text. If you’re looking for more ways to extract text from numbers, check this article out.

    Extract Text Before a Specific Character

    Function UsedTypeSyntax
    LEFTTEXT=LEFT(text,[num_chars])
    FINDINTEGER=FIND(find_text,within_text,[start_num])

    When we copy-paste from the web, our data may come accompanied by a few special characters. If they follow a pattern, create a formula using the FIND function to extract text before the character.

    The FIND function will return the position of the character inside the next. We can then use the LEFT function to only extract the text that comes before the specified character.

    Column A is supposed to be the first names of 20 employees. However, the names are followed by a series of special characters on the right.

    Nest FIND in LEFT

    We could’ve used the LEFT function to extract characters from the left. However, as the names of each individual are of varying lengths, this isn’t possible.

    Here’s the formula we used by nesting FIND inside the LEFT function:

    =LEFT(A2,(FIND("*",A2)-1)) // Extracts values before the “*” character.
    Nest FIND in LEFT

    Extract Text After a Specific Character

    Function UsedTypeSyntax
    RIGHTTEXT=RIGHT(text,[num_chars])
    FINDINTEGER=FIND(find_text,within_text,[start_num])
    LENINTEGER=LEN(text)

    Now, what if the text we’re looking to extract comes after a specific character?

    To create this formula, we will need RIGHT, FIND, and LEN. Using FIND, we will first identify the position of the character we want to extract data after. Then, we will subtract it by the total length of the text. Finally, we will enter the end value in the [num_chars] section of the RIGHT formula.

    Here’s how we used the formula to extract characters after the letter “Q” from the values in column A:

    =RIGHT(A3,(LEN(A3)-FIND("Q",A3))) // Extracts text after “Q” in the text.
    RIGHT LEN and FIND function Excel

    Extract Text Between Characters

    Function UsedTypeSyntax
    MIDTEXT=MID(text,start_num,num_chars)
    FINDINTEGER=FIND(find_text,within_text,[start_num])

    The data in column A holds the student ID of 10 individuals. Between the “/” symbols, is the batch number of each student.

    Data set

    To extract the text between the slash symbol, we will be entering the following formula:

    =MID(A3,(FIND("/",A3)+1),FIND("/",A3,FIND("/",A3)+1)-FIND("/",A3)-1)
    Extract Text between a specific text
    Asmi Dhakal

      Asmi is a content writer specializing in MS Office. She loves writing Excel-related content to assist other users to learn their way around the program. She started using Excel when she first entered the industry as a marketing intern. Soon, she realized that learning the often-overlooked spreadsheet program was no piece of cake. In her articles, she attempts to brief out complex topics to help beginner to intermediate-level Excel users. Asmi uses Excel for everything, including creating a grocery list to managing her personal finance. She’s a bit dramatic when it comes to the Flash Fill feature; so much so that could write a eulogy out of it. When she’s not working, you’ll find her learning a new recipe, or cleaning up her mess (out of the failed recipe).

      Related Posts

      Excel By Nisha Gurung

      How to Compare Two Columns in Excel Using VLOOKUP

      Excel By Nisha Gurung

      How to Share Excel Files with Multiple Users

      Excel By Nisha Gurung

      How to Filter Based on a List in Excel

      Add A Comment
      Table of ContentsToggle Table of ContentToggle
      • Extract Text from the Left
      • Extract Text from the Right
      • Extract Text from a Specific Location
      • Extract Text from Numbers
      • Extract Text Before a Specific Character
      • Extract Text After a Specific Character
      • Extract Text Between Characters
      • Home
      • About Us
      • Privacy Policy
      © 2025 Inside The Web

      Type above and press Enter to search. Press Esc to cancel.