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

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
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
Text: STR_UAT_19.3_ MWaaS : MODIFY_EXISTING_INTERFACE - Business processing area is not populating when MFTP-ID is entered.STR_UAT_19.3MWaaS
From Post # 7Fixed

<colgroup><col style="width: 25pxpx"><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]2[/TD]

[TD="align: center"]3[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]4[/TD]
[TD="align: right"][/TD]

</tbody>
Sheet675

[TABLE="width: 85%"]
<tbody>[TR]
[TD]Worksheet Formulas[TABLE="width: 100%"]
<thead>[TR="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]
[TH="width: 10px"]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
</thead><tbody>[TR]
[TH="width: 10px, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]B2[/TH]
[TD="align: left"]=TRIM(MID(SUBSTITUTE(SUBSTITUTE(A2,"_",REPT(" ",100),3),":",REPT(" ",100)),100,100))[/TD]
[/TR]
[TR]
[TH="width: 10px, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]C2[/TH]
[TD="align: left"]=TRIM(MID(SUBSTITUTE(SUBSTITUTE(A2,"_",REPT(" ",100),3),":",REPT(" ",100),2),100,100))[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]


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,224,820
Messages
6,181,161
Members
453,021
Latest member
Justyna P

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