How to use the LEFT, RIGHT and MID functions

Learn how to extract text in Excel with the LEFT, RIGHT and MID functions. Plenty of examples to learn from and functions are explained with simple words. If you start in Excel or if you are an expert, this guide is for you!

Do you want to extract some text from a cell, in Excel or in Google Sheets? Have you ever heard of the LEFT, RIGHT and MID functions?

The LEFT, RIGHT and MID functions are handy when you want to extract text from a specific cell. We’ll explain in this tutorial how to easily use these functions in Excel or in Google Sheets.

The LEFT function lets you extract characters from a text in a specific cell.
Syntax of the LEFT function: =LEFT(text,[num_chars]).

The function syntax has 2 arguments : text and [num_chars]; the last argument is optional.
* text – the cell containing the characters you want to extract.
* num_chars – how many characters you want to extract, starting from the left.

– If you don’t enter any value for [num_chars], the system assumes it means 0 if you entered =LEFT(text,). The cell containing the result will be empty.
– If you don’t enter any value for [num_chars], the system assumes it means 1 if you entered =LEFT(text).

In this example, we want to extract the part of the references containing numbers. We notice the characters we want to extract are contained within the first 6 characters. We use 6 as the [num_chars] argument.

With this in mind, the LEFT function in Google Sheets is =LEFT(string, [number_of_characters]).

The RIGHT function lets you extract characters from a text in a specific cell, starting from the right of the text string.
Syntax of the RIGHT function: =RIGHT(text,[num_chars]).

The function syntax has 2 arguments : text and [num_chars]; the last argument is optional.
* text – the cell containing the characters you want to extract.
* num_chars – how many characters you want to extract, starting from the right.

– If you don’t enter any value for [num_chars], the system assumes it means 0 if you entered =RIGHT(text,). The cell containing the result will be empty.
– If you don’t enter any value for [num_chars], the system assumes it means 1 if you entered =RIGHT(text).

In this example, we only entered the text argument: the result includes the first character of the cell, starting from the right.

In this example, we entered =RIGHT(text,): the system understood we meant 0 as the [num_chars] argument. The cell is empty.

In this example, we want the last 4 digits to appear as results. The formula we used is: =RIGHT(text,4).

If you want to use the RIGHT function in Google Sheets, you can use a similar syntax. The RIGHT formula in Google Sheets is =RIGHT(string, [number_of_characters]).

The MID function lets you extract characters from a text, starting from a specific position.
Syntax of the MID function: =MID(text,start_num,num_chars).

The function syntax has 3 arguments : text, start_num and num_chars; the last argument is optional.
* text – the cell containing the characters you want to extract.
* start_num – the starting position for the search to start from.
*
num_chars – how many characters you want to extract, starting from the start_num position and from the left.

– If you don’t enter any value for num_chars, the system assumes it means 0 if you entered =MID(text,start_num,). The cell containing the result will be empty.
– We recommend entering all the values in the MID formula.
– If the num_chars argument is higher than the characters number of the text after the starting point, the system will include all the characters found from start_num.

In this example, we want to extract the size for each reference. Mentions of the size start from position 8 and the num_chars argument is different for each reference. We decide to use a high number for this argument so all the characters including in the text, starting from position 8, will be included.

For this example, we want to extract the 2 first numbers of each phone number without any prefix.

If you want to use the MID function in Google Sheets, you can use a similar syntax than the one in Excel. The MID formula in Google Sheets is =MID(string, starting_at, extract_length).

In summary, all these functions are really handy; you can also combine them with the SEARCH function in Excel. To learn how to use SEARCH in Excel, check our tutorial!

Advertising
Analytics

Categories

AllAdvertisingFormatsPlatformsKPI'sAd News

What is O&O Advertising?

Discover one more important jargon term used in Programmatic Advertising: O&O advertising. Get familiar with O&O formats and advantages.

Read More

Best DSPs for Programmatic Advertising

Ted Jordan shares his list of best DSPs for Programmatic Advertising so you don’t have to lose time searching the internet to find the right Demand-Side Platform for your campaigns.

Read More
What is Programmatic Advertising?

What is Programmatic Advertising?

Understand what programmatic advertising is and how it works to increase your ROI and become a programmatic specialist.

Read More
Programmatic Advertising: What is a SSP?

Supply-Side Platforms (SSPs) Explained

SSPs basics in advertising: learn what Supply-Side Platforms are used for and who use them. Get familiar with more programmatic advertising technical terms.

Read More
Programmatic Advertising: What is a DSP?

What are DSPs?

A DSP is a great tool to use but what does DSP stand for in marketing? What are some Demand-Side Platforms examples? Today, we answer your questions!

Read More

Advertising News – 09 June 2024

This week, we'll explore Google's latest algorithm update and it's massive impact on independent websites, the newly passed media Freedom Act in the EU aimed at protecting journalists, and a...

Read More

Categories

AllFunctionsToolsShortcut Keys
Split Semicolon Separated Value in Excel

How to split semicolon separated values in Excel

Split semicolon separated values in Excel into columns and rows, or convert columns to semicolon separated values, like an Excel Master!

Read More

How to change shapes in Excel column charts

Learn how to easily change the columns shape in your Excel charts so your colleagues and customers will remember your impacting graphs.

Read More

How to use the LEFT, RIGHT and MID functions

Learn how to extract text in Excel with the LEFT, RIGHT and MID functions. Plenty of examples to learn from and functions are explained with simple words. If you start...

Read More

Excel IF statement: how to use it for 3 conditions

Learn how to use the Excel IF statement with multiple conditions and combine it with OR and/or AND functions!

Read More
Using Text to Column to Extract texts on Excel

Excel: How to split text into columns

If you need to extract data in Excel, you may want to use the Text to Columns tool. With only 3 steps, it's really easy to split text into columns.

Read More
Absolute Referencing in Excel

Locking cells: what’s the Excel dollar sign shortcut?

The Excel absolute reference shortcut will become one of your favourites to save time! Switch from relative to absolute references in seconds using this trick.

Read More