Extracting Value in Excel

jmartin2178

New Member
Joined
Jun 10, 2019
Messages
14
What would be the appropriate formula to extract the text between the 1st and 2nd underscores?


Text: STR_UAT_19.3_MWaaS: MODIFY_EXISTING_INTERFACE - Business processing area is not populating when MFTP-ID is entered.

* Original Value located in Column: F
 
As we do not know where the data came from I would advise against using Char 160. If the data came from the web it may already contain that character, giving the wrong result.
Using REPT is just one way of keeping the formula in one cell rather than using helper cells.
 
Upvote 0

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
what if I would like to extract the next value highlighted in Red?

Text: STR_UAT_19.3_ MWaaS : MODIFY_EXISTING_INTERFACE - Business processing area is not populating when MFTP-ID is entered.

How about
=TRIM(MID(SUBSTITUTE(SUBSTITUTE(A2,"_",REPT(" ",100),3),":",REPT(" ",100)),100,100))

Hi,

Unless the part Text: is Not part of the string, formula provided in Post # 7 did not extract the Red part as requested by OP, perhaps a "small" tweak:


Book1
ABC
2Text: STR_UAT_19.3_ MWaaS : MODIFY_EXISTING_INTERFACE - Business processing area is not populating when MFTP-ID is entered.STR_UAT_19.3MWaaS
3
4From Post # 7Fixed
Sheet675
Cell Formulas
RangeFormula
B2=TRIM(MID(SUBSTITUTE(SUBSTITUTE(A2,"_",REPT(" ",100),3),":",REPT(" ",100)),100,100))
C2=TRIM(MID(SUBSTITUTE(SUBSTITUTE(A2,"_",REPT(" ",100),3),":",REPT(" ",100),2),100,100))
 
Last edited:
Upvote 0
Hi,

Unless the part Text: is Not part of the string, formula provided in Post # 7 did not extract the Red part as requested by OP, perhaps a "small" tweak:

ABC
2Text: STR_UAT_19.3_ MWaaS : MODIFY_EXISTING_INTERFACE - Business processing area is not populating when MFTP-ID is entered.STR_UAT_19.3MWaaS
3
4From Post # 7Fixed

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

Worksheet Formulas
CellFormula
B2=TRIM(MID(SUBSTITUTE(SUBSTITUTE(A2,"_",REPT(" ",100),3),":",REPT(" ",100)),100,100))
C2=TRIM(MID(SUBSTITUTE(SUBSTITUTE(A2,"_",REPT(" ",100),3),":",REPT(" ",100),2),100,100))

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

<tbody>
</tbody>


Good catch, but in this example the "Text:" was not part of the string. Really appreciate the quick responses and think I found my new favorite message board.
 
Upvote 0
How about
=TRIM(MID(SUBSTITUTE(SUBSTITUTE(A2,"_",REPT(" ",100),3),":",REPT(" ",100)),100,100))

Thought I could figure this out with the first two examples, but one last question to getting the Red Highlighted value below.

STR_UAT_19.3_MWaaS: MODIFY_EXISTING_INTERFACE - Business processing area is not populating when MFTP-ID is entered.
 
Upvote 0
How about
=--TRIM(MID(SUBSTITUTE(A2,"_",REPT(" ",100)),200,100))

If you don't want to convert to a number, remove the -- at the start
 
Upvote 0
Here's a single formula option to extract All 3 parts separately:


Book1
ABCD
2STR_UAT_19.3_ MWaaS : MODIFY_EXISTING_INTERFACE - Business processing area is not populating when MFTP-ID is entered.UAT19.3MWaaS
Sheet681
Cell Formulas
RangeFormula
B2=TRIM(MID(SUBSTITUTE(SUBSTITUTE($A2,":","_"),"_",REPT(" ",100)),COLUMNS($B1:B1)*100,100))


B2 formula copied across to D2.

If you want the values extracted vertically instead, let us know, will tweak formula to accommodate.
 
Upvote 0

Forum statistics

Threads
1,215,543
Messages
6,125,423
Members
449,223
Latest member
Narrian

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