# Listing out 5 characters after certain string?

#### JV63

##### New Member
Hi. I have a string for example like this:

AT R05DD84100TL DAAIA84100OT01A1ZTM DGMFL00991

I want to be able to list out only the 5 characters after "OT". So in the above example it would be 01A1Z.

I can do that in two different cells using:

=MID(A2,FIND("OT",A2)+2,LEN(A2)) which gives me:
 01A1ZTM DGMFL00991

<tbody>
</tbody>

And then using:

=LEFT(B2,5) which will give me the 01A1Z

Is there a way to combine those functions or use something different which will give me what I need in one formula?

The OT that I'm looking for isn't always in the same spot of a string. In can be for example:

 AT R05DD84100TL DAAIA84100OT01A1ZTM DGMFL00991 ATA02A1DD05100TL AAATM ACAOT03A2CIA05100 ATA02A2DD05300TL DCATM DGBNB OT03A2MNC FF IA05300 Thanks

<colgroup><col></colgroup><tbody>
</tbody>

<tbody>
</tbody>

### Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.

=MID(A2,FIND("OT",A2)+2,5)

Try this.

=MID(A2, FIND("OT",A2)+2,5)

There are simpler options (as shown above), but you have already pretty much done all the work!
=LEFT(MID(A2,FIND("OT",A2)+2,LEN(A2)),5)

Last edited:
try

=MID(A2,FIND("OT",A2)+2,5)

Thanks everyone for the quick replies. I was close

=MID(A2,FIND("OT",A2)+2,5) worked perfectly.

Replies
3
Views
167
Replies
2
Views
598
Replies
16
Views
448
Replies
7
Views
338
Replies
8
Views
207

1,196,057
Messages
6,013,159
Members
441,751
Latest member
336448

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back