Formula to Extract Text (instead of using Text to Columns)

seenai

Board Regular
Joined
Mar 31, 2013
Messages
54
Hi,

I need an excel formula to extract the text between characters "_" (underscore)

Eg in Cell A1 : IN18059850_Plant_T0_1218_New Failure

I need Column B1, C1, D1, E1, F1 to extract the text between '_'

Help me to get the data.
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
with PowerQuery (Get&Transform)

Code:
[SIZE=1]let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    Split = Table.SplitColumn(Source, "Column1", Splitter.SplitTextByDelimiter("_", QuoteStyle.Csv), {"Column1.1", "Column1.2", "Column1.3", "Column1.4", "Column1.5"})
in
    Split[/SIZE]

[Table="width:, class:head"]
[tr=bgcolor:#FFFFFF][td=bgcolor:#5B9BD5]Column1[/td][td][/td][td=bgcolor:#70AD47]Column1.1[/td][td=bgcolor:#70AD47]Column1.2[/td][td=bgcolor:#70AD47]Column1.3[/td][td=bgcolor:#70AD47]Column1.4[/td][td=bgcolor:#70AD47]Column1.5[/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#DDEBF7]IN18059850_Plant_T0_1218_New Failure[/td][td][/td][td=bgcolor:#E2EFDA]IN18059850[/td][td=bgcolor:#E2EFDA]Plant[/td][td=bgcolor:#E2EFDA]T0[/td][td=bgcolor:#E2EFDA]1218[/td][td=bgcolor:#E2EFDA]New Failure[/td][/tr]
[/table]
 
Upvote 0
Try:

ABCDEF
IN18059850_Plant_T0_1218_New FailureIN18059850PlantT0New Failure

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

[TD="align: right"]1218[/TD]

</tbody>
Sheet1

[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] "]B1[/TH]
[TD="align: left"]=TRIM(MID(SUBSTITUTE($A1,"_",REPT(" ",999)),COLUMNS($B1:B1)*999-998,999))[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
Put the following formula in B1 and copy to the right

=TRIM(MID(SUBSTITUTE($A1,"_",REPT(" ",99)),IF(COLUMN()=2,1,99*(COLUMN()-2)),50))
 
Upvote 0
hI,

Thank you very much for your solution.

B.Srinivasa Rao

Try:

ABCDEF
IN18059850_Plant_T0_1218_New FailureIN18059850PlantT0New Failure

<tbody>
[TD="align: center"]1[/TD]

[TD="align: right"]1218[/TD]

</tbody>
Sheet1

[TABLE="width: 85%"]
<tbody>[TR]
[TD]Worksheet Formulas[TABLE="width: 100%"]
<tbody>[TR]
[TH]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
[TR]
[TH]B1[/TH]
[TD="align: left"]=TRIM(MID(SUBSTITUTE($A1,"_",REPT(" ",999)),COLUMNS($B1:B1)*999-998,999))[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0

Forum statistics

Threads
1,225,207
Messages
6,183,585
Members
453,173
Latest member
Ali4772

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