Fine Text between Dashes in Excel

khanzgem

New Member
Joined
Nov 7, 2015
Messages
16
Hello,

[TABLE="width: 256"]
[TR]
[TD][TABLE="width: 256"]
[TR]
[TD]I need to find out text between the dashes.

[TABLE="width: 256"]
[TR]
[TD]JAWAD AHMAD SAHIBZADA - Sem-1 - MSEM-F2018 - R.No.MS 155-2018 Fee Deposited.[/TD]
[/TR]
[TR]
[/TR]
[/TABLE]
1.Between 1st & 3rd Dashes ( Sem-1)
2.Between 3rd & 5th Dashed ( MSEM-F2018)

[/TD]
[/TR]
[/TABLE]
[/TD]
[/TR]
[/TABLE]
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Assuming that you can use " - " as the delimiter (rather than just a dash), you can get the two values with the following formulas:
(B112 holds your data):

Code:
=TRIM(MID(SUBSTITUTE(B112," - ",REPT(" ",100)),100,100))

returns [TABLE="width: 148"]
[TR]
[TD="width: 148"]Sem-1[/TD]
[/TR]
[/TABLE]

and

Code:
=TRIM(MID(SUBSTITUTE(B112," - ",REPT(" ",100)),200,100))

returns
[TABLE="width: 148"]
[TR]
[TD="width: 148"]MSEM-F2018[/TD]
[/TR]
[/TABLE]
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,177
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