Text Formulas – MID() & LEN()

3 minutes
Share the link to this page
You need to purchase the class to view this lesson.
One-time Purchase
List Price:  $139.99
You save:  $40
List Price:  د.إ514.18
You save:  د.إ146.92
List Price:  A$180.54
You save:  A$51.58
List Price:  ৳11,866.68
You save:  ৳3,390.72
List Price:  CA$176.88
You save:  CA$50.54
CHF 88.56
List Price:  CHF 123.99
You save:  CHF 35.42
List Price:  kr856.85
You save:  kr244.83
List Price:  €115.16
You save:  €32.90
List Price:  £102.10
You save:  £29.17
List Price:  HK$1,085.16
You save:  HK$310.07
List Price:  ₹10,216.03
You save:  ₹2,919.07
List Price:  RM564.15
You save:  RM161.20
List Price:  ₦53,196.20
You save:  ₦15,200
List Price:  kr1,178.92
You save:  kr336.86
List Price:  NZ$194.68
You save:  NZ$55.62
List Price:  ₱6,730.59
You save:  ₱1,923.16
List Price:  ₨22,489.39
You save:  ₨6,426
List Price:  S$185.22
You save:  S$52.92
List Price:  ฿4,192.56
You save:  ฿1,197.96
List Price:  ₺1,033.78
You save:  ₺295.38
List Price:  B$750.37
You save:  B$214.40
List Price:  R2,095.15
You save:  R598.65
List Price:  Лв225.25
You save:  Лв64.36
List Price:  ₩154,078.01
You save:  ₩44,025.43
List Price:  ₪458.17
You save:  ₪130.91
Already have an account? Log In


Hello everybody. Assuming that you have gone through our videos, our sessions on left and right formula, you now proceed towards mid formula made formula very powerful if you intend to extract data based on certain preconditions, which you want to configure. First, let's take help of an example. I have a couple of pan or a pan in India, every individual every initial assessee, probably a taxpayer who needs to get a pan registered permanent account number. So it's typically in a form where there are five characters in text followed by four in numeric form and the last one being a single character alphabetical character, but the unique part about this is the fourth character signifies the assessee status, and that I have given in the next sheet. So there is a table which says if the fourth character of the pan number is C, it means it's been registered under company.

If it's a fourth characterising p, it means a person so on so forth. So if so forth characters, let's say P, it says association of person, typically a trust. So now, how do I know that to these pan number, what associate status May I associate with? First I need to extract the fourth character by C equal to left, I choose the pan number, comma, and I say four. If I do that, notice it takes all four characters and extract them in the cell. I don't want that.

I want only one letter and that too from the fourth position. So here, I've using the mid formula mid chooses the cell after having done so it then tells me from which position do you want to start, I want to start from the fourth position. And from the fourth position, how many number of characters do you want to take out I want to take out one number of characters into There you go, one character as a copy pasted down, I get the full set of results. And not only that, just for a little bit of experimentation, had I written two. Can you guess what is that I'm going to get in the answer. From the fourth position, you're going to extract two characters, which means double P, and that's exactly what I'm going to get.

So my initial requirement was just one character, and I'll stick to it. And that's what I get. Now, if you apply a very quick v lookup, you will be able to find out what is the assessee status. So we look up look for letter P, comma, table array, which means I need to go to the other sheet where the table has already been prepared. As I choose it, I ensure that the range is fixed by pressing f4 once it has been fixed, I put a comma and then column index number two because the answers were in the second column of the table and finally false or zero. close the bracket.

So it looks for the letter P and finds out it's a person. What if individuals company, company person and false so there you go. This was a quick tutorial on mid formula and in Indian context, how do you extract the RCC status based on the pan number? In fact, generally I also apply another test logic which ensures that the length of characters are correct as it's supposed to be. So as I copy pasted down, notice one of the pan number has been misspelled because there are 11 characters which is not correct. It was just an add on.

The main point is with respect to mid formula in context of left and right

Sign Up


Share with friends, get 20% off
Invite your friends to TabletWise learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.