Extract numbers from cell after 5th / character

eaxlns

New Member
Joined
Apr 18, 2019
Messages
15
Office Version
  1. 365
Platform
  1. MacOS
Hi All,
Hope some of you clever folk can help me. I wanted to extract the number in the following URL, it is after the fifth "/", and before the "?":

https://www.ebay.co.uk/itm/TomTom-GO-520-5-Sat-Nav-Wi-Fi-Lifetime-World-Maps-Traffic-Speed-Cameras-Updates/201742112656?hash=item2ef8c45790:g:3gEAAOSwBzpbjrNH

<colgroup><col width="87" style="width: 65pt;"></colgroup><tbody>
</tbody>

The number in this case is 201742112656.

Thanks in advance!
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
with PowerQuery aka Get&Transform:

urlText Between Delimiters
https://www.ebay.co.uk/itm/TomTom-GO-520-5-Sat-Nav-Wi-Fi-Lifetime-World-Maps-Traffic-Speed-Cameras-Updates/201742112656?hash=item2ef8c45790:g:3gEAAOSwBzpbjrNH201742112656

Code:
[SIZE=1]let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    Between = Table.AddColumn(Source, "Text Between Delimiters", each Text.BetweenDelimiters([url], "/", "?", 4, 0), type text)
in
    Between[/SIZE]

or

Code:
[SIZE=1]let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    Extract = Table.TransformColumns(Source, {{"url", each Text.BetweenDelimiters(_, "/", "?", 4, 0), type text}})
in
    Extract[/SIZE]
 
Last edited:
Upvote 0
Try:

=TRIM(LEFT(SUBSTITUTE(MID(A1,FIND("|",SUBSTITUTE(A1,"/","|",5))+1,LEN(A1)),"?",REPT(" ",LEN(A1))),LEN(A1)))
 
Upvote 0
Thank you for your speedy reply, sandy666, but how can I do this as a formula, as I need the result in another sheet's cell?
 
Upvote 0
this is a PowerQuery so you'll need Excel 2010/2013 and PQ add-in or 2016 and above with PQ (Get&Transform) built-in

Formula is in post #3 by Eric W
 
Upvote 0
How about:

=TRIM(MID(SUBSTITUTE(SUBSTITUTE(A1,"/",REPT(" ",500),5),"?",REPT(" ",500)),500,500))
 
Upvote 0
One more...

=TRIM(MID(SUBSTITUTE(SUBSTITUTE(A1,"?","/"),"/",REPT(" ",500)),2500,500))
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,978
Messages
6,122,549
Members
449,089
Latest member
davidcom

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