How to Use LEFT, RIGHT, and MID Functions in Excel

The LEFT, RIGHT, and MID functions are essential Excel tools for working with text data. They allow you to extract specific parts of a text string, such as codes, IDs, or labels. In this lesson, you’ll learn how these functions work and see how they’re used to separate work order prefixes, customer IDs, and state codes from system-generated fields, making your data easier to analyze and report on.

Download the Excel file used in this tutorial:

The LEFT, RIGHT, and MID Functions in Excel

This walkthrough shows how to use the LEFT, RIGHT, and MID functions to pull specific pieces of text from larger IDs or exported text strings.

1. Start with a text field that contains multiple pieces of information

  • Use a text string that combines several identifiers in one cell
  • In the video, the examples include values like work order codes, customer IDs, and state abbreviations
  • The goal is to separate those pieces into their own columns

2. Use the LEFT function to pull characters from the beginning of a text string

  • LEFT returns the number of characters you choose from the left side of a cell
  • This is useful when the first part of the text always contains a code or prefix
  • In the video, this is used to pull the work order prefix
  • It is also shown as a way to pull the first few characters for a customer-related identifier

3. Adjust the number of characters returned with LEFT

  • Change the character count depending on how much of the text you want to extract
  • Returning fewer characters gives you just the short prefix
  • Returning more characters includes additional symbols or numbers
  • This makes LEFT useful when you need either a short code or a slightly longer identifier from the start of the string

4. Use the RIGHT function to pull characters from the end of a text string

  • RIGHT returns the number of characters you choose from the right side of a cell
  • This works well when the ending part of the text always contains a fixed-length ID
  • In the video, RIGHT is used to extract the customer ID
  • Because the ID length is consistent, the same character count can be used for every row

5. Use MID when the text you need is in the middle

  • MID extracts characters starting from a position you define inside the text string
  • Unlike LEFT and RIGHT, MID needs a starting point
  • It also needs the number of characters to return
  • In the video, MID is used to isolate the state abbreviation from the middle of the string

6. Count the starting position carefully for MID

  • Identify where the target text begins inside the full string
  • Count the characters until you reach the first character you want to return
  • In the example, the function starts at the position where the state code begins
  • Then it returns only the two characters needed for the state abbreviation

7. Use the extracted text in other Excel functions

  • Once the text has been separated into a clean helper column, it can be used in other calculations
  • In the video, the extracted state code is then used with COUNTIFS
  • This makes it possible to count how many records belong to a specific state
  • The key point is that helper columns make downstream analysis much easier

8. Combine text functions when exports become more complex

  • The video also explains that these functions become even more useful when text strings contain multiple separators or inconsistent labels
  • In more advanced cases, LEFT, RIGHT, and MID can be combined together
  • They are often paired with FIND when you need to locate characters between dashes or other delimiters
  • Even though FIND is not fully covered in this lesson, it is mentioned as the next step for more advanced text parsing

9. Use these functions to clean exported data

  • These functions are especially helpful when working with system-generated exports
  • They let you pull out prefixes, suffixes, state codes, customer numbers, and other variables
  • Once those values are separated, you can sort, count, filter, and analyze them much more easily

LEFT, RIGHT, and MID Functions in Excel

Q1. What do the LEFT, RIGHT, and MID functions do in Excel?
These functions extract specific portions of text from a cell. LEFT returns characters from the beginning, RIGHT returns characters from the end, and MID extracts characters from the middle based on a starting position.

Q2. Why are these functions important for data analysis?
Many datasets contain combined or system-generated text fields. These functions allow you to separate meaningful information like customer IDs, region codes, or job types, making your data easier to analyze and use in reports.

Q3. What is the difference between LEFT, RIGHT, and MID?

  • LEFT: Extracts a set number of characters from the start of a text string
  • RIGHT: Extracts characters from the end
  • MID: Extracts characters from the middle using a defined starting point and length

Q4. When should I use the MID function instead of LEFT or RIGHT?
Use MID when the data you need is located somewhere in the middle of a text string, especially when it’s surrounded by consistent patterns like dashes or prefixes.

Q5. Can these functions be combined with other Excel formulas?
Yes. These functions are often combined with others like FIND, LEN, or COUNTIFS to create more dynamic and advanced text transformations.

Q6. What are common use cases for these functions?
They are commonly used to extract values such as work order prefixes, customer numbers, state codes, product categories, or any structured text embedded within a larger string.

Get more lessons like this
by joining our newsletter

Receive weekly Excel tutorials, tips, and KPIs straight to your inbox

Databoards

Analysis & Development