Text String Extraction

jbuchhorn

New Member
Joined
Oct 17, 2017
Messages
5
Hi,

I have two related issues regarding the extraction of a portion of a text string which can be noted as 1) and 2) below.

1) In the case where I have some example inputs of R6.300, R10.300 & N10.300, I would like to be able to extract the numerical value proceeding the capital letter - in the case of my examples: 6, 10, 10 respectively. I have managed to make it work for each individual case (either N or R) but would ideally like a consistent formula that works for both (note that the number proceeding the letter ranges from single to double digit values only).

2) In the case where I have some example input R8, R8a, R10, R10a, R10b, I would like to be able to extract the numerical value proceeding the capital letter and terminates at either the end of the text, or the lower case letter - in the case of my examples: 8, 8, 10, 10, 10 respectively. I have managed to make it work for each individual (no letter following the number, a following the number, b following the number) but would ideally like a consistent formula that works for both (note that the number proceeding the capital letter ranges from single to double digit values only).

Any help would be greatly appreciated.

Cheers,

Jack
 
Hi, based on this and the examples from post#1 here is another option.

Excel 2013/2016
AB
1R6.3006
2R10.30010
3N10.30010
4R88
5R8a8
6R1010
7R10a10
8R10b10

<colgroup><col style="width: 25pxpx"><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet2

Worksheet Formulas
CellFormula
B1=IFERROR(MID(A1,2,2)+0,MID(A1,2,1)+0)

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>

This is perfect, exactly what I want! Would you mind explaining how the worksheet formula works?
 
Upvote 0

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.

Forum statistics

Threads
1,215,086
Messages
6,123,038
Members
449,092
Latest member
ikke

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Back
Top