The function takes a string in Excel

The function takes a string in Excel Picture 1

The function to get the string in Excel includes 3 types of LEFT, MID and RIGHT with different string functions. To better understand the three types of functions that take these strings, please follow the following article of TipsMake.com.

1. The formula of the function takes a string of characters

Basically, the string grab function has the function of retrieving a consecutive string from another long string. Speaking of which, you certainly have a glimpse of the other three functions that take strings based on their names.

The names of these 3 functions are in English letters, of which LEFT is left, MID stands for middle meaning middle and RIGHT is right.

From there you will see the effect and how to get the sequence of these functions, it depends on the position of the character you need to get from the original character.

With the LEFT function , you get the character string from the left of the original string.

MID function , you will get the string between.

And the RIGHT function , you get the text string to the right of the original.

1.1. The function takes the string LEFT

The formula of the function takes the LEFT string :

= LEFT (String of original characters; number of characters to be retrieved)

Inside:

The original character string is the original string for you to extract and retrieve the consecutive characters you need.

The number of characters you will retrieve is the number of characters you will retrieve from left to right.

As the example below, we need to get the first letter in the series of original characters so the required formula is:

= LEFT (A2; 1)

The function takes a string in Excel Picture 2

Then you copy the formula down by double clicking on the bottom right corner of the formula cell or clicking on that position and dragging down.

The function takes a string in Excel Picture 3

1.2. The function takes the MID string

Formula of the MID function:

= MID (Original string; starting position of the string, number of characters removed)

Inside:

The original character string is the original string for you to extract and retrieve the consecutive characters you need.

The starting position for the string is written in numbers. Unlike the LEFT function , the MID function starts to retrieve a string from any position in the middle of the original string. That's why we need to tell this function where we need to start to get characters from. The number will count the number of characters from the first character to the last character.

The number of characters you will retrieve is the number of characters you will retrieve from left to right.

As the following example, we need to get the middle character from position 2, and the number of characters to get is 3 so we have the formula:

= MID (A2; 2; 3)

The function takes a string in Excel Picture 4

Then you copy the formula down by double clicking on the bottom right corner of the formula cell or clicking on that position and dragging down.

The function takes a string in Excel Picture 5

1.3. The function takes the string RIGHT

The formula of the function takes the string RIGHT:

= RIGHT (The original string of characters; the number of characters to be retrieved)

Inside:

The original character string is the original string for you to extract and retrieve the consecutive characters you need.

The number of characters you will retrieve is the number of characters you will retrieve from right to left.

As the example below, we need to get the first letter in the series of original characters so the required formula is:

= RIGHT (A2; 3)

The function takes a string in Excel Picture 6

Then you copy the formula down by double clicking on the bottom right corner of the formula cell or clicking on that position and dragging down.

The function takes a string in Excel Picture 7

2. Character string function combined with other functions

A simple example of practical functions that take LEFT , MID and RIGHT characters often goes in conjunction with conditional functions such as the IF function or the VLOOKUP reference lookup function .

Based on the example used above, I can use the IF function to specify the selling method of orders.

We have the following formula:

= IF (LEFT (A2; 1) = "S"; "Ship"; "Cost")

Explain:

If the first letters of the Order ID are S , the value "Ship" is returned, otherwise the "Cost" value is returned. So we can see we need a string grab function here to extract the first letter in the Order ID string .

The function takes a string in Excel Picture 8

Then you just copy the formula used to all the lines below.

The function takes a string in Excel Picture 9

But the IF function can only be used when you have two different types of results (Ship and Cost) but when there are too many types of results to collate, you must use the RIGHT function .

We have the formula combined with the VLOOKUP function as follows:

= VLOOKUP (RIGHT (A2; 3); $ A $ 11: $ B $ 18; 2; 0)

Explain:

We rely on the last 3 letters of the Order ID with the code comparison table below to know the full name of the item. So the same principle as using IF , we need RIGHT to retrieve the last three characters of the Order ID so that VLOOKUP can read and understand what the item code needs to be compared.

The function takes a string in Excel Picture 10

Finally, you copy the formula down to get a list of item names.

The function takes a string in Excel Picture 11

Thank you for following up on our article on the string grab function in Excel. TipsMake.com hopes that this article will give you a little more knowledge about the types of Excel string functions.

4 ★ | 1 Vote

May be interested

  • Cause Excel File is unusually heavy and how to fix itPhoto of Cause Excel File is unusually heavy and how to fix it
    there are many reasons why your excel file is unusually heavy. they are most likely due to user error in interacting with the data. to find out what causes this and how to fix it, we will come with the following article of tipsmake.com.
  • How to compare 2 Excel files to see if there is any differencePhoto of How to compare 2 Excel files to see if there is any difference
    if you work with excel spreadsheets regularly, we can easily find out the differences on excel files. but if you are new to excel and you have to compare 2 excel files to see what is different but do not know how? please follow the article below to answer that question!
  • How to install and use Google Docs OfflinePhoto of How to install and use Google Docs Offline
    you can create documents including text editors or presentation files. you can even share these online documents and even edit with others. also you can use google docs when offline without network. that is the content of today's article.
  • How to turn to a new page and add a new page in WordPhoto of How to turn to a new page and add a new page in Word
    how to turn to a new page and add a new page in word. for office workers, the word software is one of their most basic tools, with word users can create a lot of different content through the editing of typed text. word now owns many outstanding features that support the maximum for users.
  • Instructions on how to recover USB dataPhoto of Instructions on how to recover USB data
    instructions on how to recover usb data. with usb, when infected, the system will be robbed of access and hide the files contained in the usb to make users think that we lost data. in this case we handle it very quickly through the following steps:
  • How to convert PowerPoint slides to VideoPhoto of How to convert PowerPoint slides to Video
    turning powerpoint presentation slides is a pretty cool and useful trick. when converted into a video, you can open your presentation anywhere without having to install powerpoint, you can open it on a big screen tv to watch, open on a smartphone ... etc. the following article by tipsmake vn will guide you to do this.