Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

If you manipulate data in Excel, you may find yourself needing to extract substrings from strings. This is a deep dive into the methods available to manipulate strings in Excel.

Overview

An Excel substring is a portion of a text in a cell. For instance, if a cell contains the words “Excel substring”, you may want to extract “Excel”, “substring”, “Excel Sub” or even “substring”.

I will show you how to extract texts from within a cell in this guide. I will use a combination of Text (LEFT, RIGHT, and MID) SUBSTITUTEand SEARCH functions to get substrings from before, end or after a specific character of a string.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Option 1: Get a Substring at the Start, Middle, or End of a String

You can get a substring from the end, middle or beginning of a string. The following sections covers how to do this.

Popular on Amazon
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter | 4Pack Type C Female to A Male Cable Converter for Apple Duo 17 16 15 14 Plus,iWatch Watch 12 11 10,iPad 9 8 Air,Airpods 5 4
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

How to Get Excel Substring from the Start of a String

Excel Substring get substring from the beginning of a string using the LEFT

You can get substrings from the left of a string in Excel using the LEFT Function.

Below is the Syntax of the LEFT Function:

LEFT(text, [num_chars]) 

Text is a (required parameter): This is the text string you want to extract the Excel substring from.
Num_chars parameter is Optional. Characters count (subsrting) you want the LEFT function to extract from the string.

If you do not specify the Num_chars (Characters from left of the string), Excel will get the first character.

To get the first 4 characters from this string, 7OV1-BK8P-QD9Y use the following formula:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
=LEFT(A6,4)

The formula above assumes that the string is in cell A6. Here is the result.

Excel Substring LEFT Example

You can also specify the string directly in the formula as shown below

=LEFT("OV71-BKP8-QDY9",4)

It produces the same result as shown below:

How to Get Excel Substring from the Right of a String (RIGHT)

The RIGHT function is used to get substring from the right of a string.

Here is the Syntax:

RIGHT(text,[num_chars]) 

Text (Required parameter): The text string containing the characters you want to extract.
Num_chars (Optional parameter): Characters you want RIGHT to extract right of the string.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Continuing from the previous example, to extract the first 5 characters counting from the right of this string, 7OV1-BK8P-QD9Y use the formula:

Also popular on Amazon
Sale
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter | USB C Dongle with 90W Max Power Delivery, 3×5Gbps USB A Data Ports, for MacBook, Dell, and More (Charger Not Included)
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
=RIGHT(A2,5)
For the above formula, the original string is in cell A2. 5 is the number of characters to extract, counting from right.

The result in Excel:

Excel Substring RIGHT Example

How to Get Excel Substring Within a String (MID)

How to Get Excel Substring Within a String (MID)

There are circumstances you may need to extract excel substring from within a string. You will need the MID function for this.

The Syntax of the MID function is:

MID(text, start_num, num_chars) 

Text (Required): The Excel string with the characters you want to extract.
Start_num (Required): The position of the first character you want to extract in text. The first character in text has start_num 1, and so on.
Num_chars (Required): Specifies the number of characters you want MID to return from text.

As an example, to extract BK8P substring from from 7OV1-BK8P-QD9Y, use this:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
=MID(A2,6,4)

This tells Excel to extract 4 characters from cell A2, starting from the 6th character. See the result in Excel.

Option 2: Get Substring Before or After a Specific Character

So far, this guide have covered how to extract excel substing from the beginning, within and end of a string. In this section, I will discuss how to extract a substring after a particular character.

How to Get Excel Substring Before a Specific Character

In this example, I will show you how to get all characters before the first hyphen (counting from left) in 7OV1–BK8P-QD9Y.

There are 2 steps to complete this task:

  1. Use SEARCH function to determine the position of the character, “-“.
  2. Use LEFT function to extract all characters from the position determined by the SEARCH function

First, I will show how to use SEARCH to determine the position of the character.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Here is the Syntax of the SEARCH function:

SEARCH(find_text,within_text,[start_num])

find_text (Required): This is the text you want to find. In our ongoing example, this will be the hyphen, “-“.
within_text (Required): The text in which you want to search for the value of the find_text argument. This is usually the cell number containing the text. For example, the cell containing 7OV1–BK8P-QD9Y.
start_num (Optional): The character number in the within_text argument at which you want to start searching.

Also popular on Amazon
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter | 85W Max PD, 2 USB 3.0 & 1 USBC Data Ports, SD/TF Card Reader, for Laptops/Mac and Other Type C Devices (Charger Not Included)
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

To get the position of the first hyphen, “-” in 7OV1-BK8P-QD9Y, use the formula:

=SEARCH("-", A2)

The result is 5 as shown in the result below:

The next step is to use the LEFT function to extract all substrings before “-“. Below is the Syntax:

LEFT(text,(SEARCH(find_text, within_text))-1)

text: is a parameter of FIND. This is the original string (usually the cell containing the text)
find_text: is a parameter of SEARCH. This specifies the character you want to extract all characters before it.
within_text: Still a parameter of SEARCH. Same as text parameter in this instance.
1: The value returned by SEARCH is usually over by 1. Subtracting 1 corrects the result.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

And now the formula for our example:

=LEFT(A2,(SEARCH("-", A2))-1)

To make the seemingly complex formula easy to understand, I will break it down into the 2 parts. Then put it together again.

Part 1:

LEFT(A2, num_chars)

Here, LEFT will extract num_chars from the text in cell A2. num_chars is the number of characters from the left of the text to extract.

Part 2

(SEARCH("-", A2))-1

This tells SEARCH to find the position of “-” character from the text in cell A2.

When we put it together, we replace num_chars in LEFT function with (SEARCH(“-“, A2))-1. And here is the combined formula:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
=LEFT(A2,(SEARCH("-", A2))-1)

And the result in Excel:

The formula is simply a FIND function that uses the SEARCH to determine the number of characters to extract from.

How to Get Excel Substring After a Specific Character

In this section, I will demonstrate how to extract Excel substring after a specific character. I want to extract all characters after the first “-” in 7OV1-BK8P-QD9Y.

Also popular on Amazon
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray | Data transfer & Fast charging for MacBook, iPhone 17/16/15, iPad, Samsung Galaxy, Apple Watch
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Widely Compatible: Transform any USB-C port into a USB-A port and USB-A port into a USB-C port, and connect up a wide range of USB-C(including MacBook, iPad Pro/Air/Mini, iPhone models with USB C ports, Samsung Galaxy series, and Google Pixel series. ) and USB A devices(including external hard drives, phones, mice, printers, and more)
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft

The formula is similar to the example in the last section. The difference is that in this section, I will replace LEFT with RIGHT function. I will also use the within_text parameter in the SEARCH function.

Here is the general syntax for extracting Excel substring after a specific character in a text.

=RIGHT(text ,(SEARCH(find_text, text, within_text ))-1)

text: Is a parameter of the RIGHT function. This is the cell containing the string you wish to extract Excel substring from.
find_text: SEARCH parameter. Specifies the character you wish to extract characters from.
text: The second text is a parameter of SEARCH function. This is the cell containing the string you are extracting from.
within_text: This is used to tell SEARCH from what character to search for find_text. In our example within_text is “-“.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

And here is the formula to extract all characters after the first “-” in 7OV1-BK8P-QD9Y

=RIGHT(A2,(SEARCH("-", A2,6))-1)

A2 is the cell with the text. “-” is the character we are extracting after and 6 is the character we are SEARCHING for “-“, from the right of the original string.

Below is the result in excel.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Option 3: Count How Many Times a Substring Appears in Excel

Count How Many Times Substring Appears in Excel

In the last section of this guide, I will show how to count how many times a substring appears in a text.

The Syntax to count the number of times a specific character appears in string is:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
=LEN(text)-LEN(SUBSTITUTE(text, count_text,""))

text: is the main string we want to count from
count_text: is the character we want to count.

Also popular on Amazon
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display | 85W Max PD, 1 Powered USB-C 5Gbps & 2 Powered USB-A 3.0 5Gbps Data Ports, for MacBook Pro, MacBook Air, Dell and More (Black)
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
In the formula, SUBSTITUTE removes all of the characters being counted in the source text. Then the length of the substring (with the character removed) is subtracted from the length of the original string. The result is the number of times the counted sustring appears in the original string.

For example, to count how many times “-” appears in 7OV1-BK8P-QD9Y, use the formula:

=LEN(A2)-LEN(SUBSTITUTE(A2,"-",""))

Breaking it down:

Let’s start with the formula:

=SUBSTITUTE(A2,"-","") 

This removes the character, “-” we want to count from the source string, 7OV1-BK8P-QD9Y. The result is 7OV1BK8PQD9Y as shown below:

Count How Many Times Substring Appears in Excel - SUBSTITUTE removes all of the characters being counted in the source text

Next, LEN function counts the characters left after the text we wish to count has been removed from the original text.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Here is the formula

=LEN(SUBSTITUTE(A2,"-",""))
The formula includes SUBSTITUTE(A2,”-“,””) into the LEN function. Here is the result, 12.

Then, we count the number of characters in the original string, with this formula:

=LEN(A2) 

The original text has 14 characters as shown below:

Finally, subtract LEN(SUBSTITUTE(A2,”-“,””)) from LEN(A2)

=LEN(A2)-LEN(SUBSTITUTE(A2,"-",""))

And the final result is 2. See the result in Excel below.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Conclusion

I hope this guide simplified Excel substring for you!

I also hope you found the Itechguide helpful. If you did, please share your experience using Excel substring at [discourse_topic_url].

You could also ask a question or leave a comment on our forum at [discourse_topic_url]. Our community will attend to you as soon as possible.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.