removing unwanted characters from a column

pavan5

Board Regular
Joined
Jun 13, 2017
Messages
56
Hi ,

I have a column B which contains data
[TABLE="width: 687"]
<colgroup><col></colgroup><tbody>[TR]
[TD]External Video ID[/TD]
[/TR]
[TR]
[TD]382926____130510783____vod://fyi.tv/FYHT1863761708020000[/TD]
[/TR]
[TR]
[TD]vod://_c_fyi.tv/FYHT1863761708020000[/TD]
[/TR]
[TR]
[TD]382926____130497710____vod://fyi.tv/FYST1863761708020000[/TD]
[/TR]
[TR]
[TD]vod://_c_fyi.tv/FYST1863761708020000[/TD]
[/TR]
[TR]
[TD]382926____129824987____vod://fyi.tv/FYHT1863751707260000[/TD]
[/TR]
[TR]
[TD]vod://_c_fyi.tv/FYHT1863751707260000

[TABLE="width: 687"]
<tbody>[TR]
[TD="width: 687"]from these I want to extract only a particular id , id part is 6 digits starting from 11th digit from end (reverse of the string) and is of 6 digits in SQL I'm able to get this using various function like below, but not able to get it in excel.

example from the first row the id is : 186376

IF LOWER(videoAssetCustomId) LIKE '%vod%' THEN COALESCE(CAST(reverse(substr(reverse(videoAssetCustomId), 11, 6)) AS INT), -99)
WHEN videoassetcustomid RLIKE '^.*_.*$' THEN substring(videoassetcustomid, 0, instr(videoassetcustomid, '_') - 1)
ELSE COALESCE(CAST(videoAssetCustomId AS INT), -99)
END AS INT) AS program_id
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]

can someone help me here with this
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Give this formula a try...

=LEFT(RIGHT(A1,16),6)

thank you works like a charm !

also if the column contains something like below
192099_00_1035134531626
with out the word 'vod' , the id starts from 1 to 6 digits in the above example the id is : 192099
 
Upvote 0
also if the column contains something like below
192099_00_1035134531626
with out the word 'vod' , the id starts from 1 to 6 digits in the above example the id is : 192099
See if this does what you want...

=IF(ISNUMBER(SEARCH("vod",A1)),LEFT(RIGHT(A1,16),6),LEFT(A1,6))
 
Upvote 0

Forum statistics

Threads
1,223,894
Messages
6,175,254
Members
452,623
Latest member
Techenthusiast

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