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

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
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,224,822
Messages
6,181,165
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