-1

How do I pull the ASIN code from an Amazon url in Excel?

Variable length URL's, example:

Want to derive the cell result : B00BQ59SYM

from this

http://www.amazon.com/Dyna-Glo-DGB730SNB-D-Dual-Fuel-Grill/dp/B00BQ59SYM/ref=sr_1_7?ie=UTF8&qid=1428647284&sr=8-7&keywords=hybrid+grill

But could also be from this URL to the same location:

http://www.amazon.com/dp/B00BQ59SYM?psc=1

2
  • Probably you need to use regular expressions (e.g. regEx add-in). Apr 10, 2015 at 7:15
  • It's everything after the first /dp/ and up to either a /, a ?, or the end of the URL. Apr 10, 2015 at 8:44

3 Answers 3

5

=MID(A1,FIND("dp/",A1)+3,10) Place your url in A1

-1

Slightly unrelated - but if you are doing Google Spreadsheet this can be done using

=REGEXEXTRACT(A1, "/([a-zA-Z0-9]{10})(?:[/?]|$)")

I am sure similar regex may work in Excel too.

-2

For Google Sheets I have tested the code It works with ";" instead ","

so

=REGEXEXTRACT(A1;"/([a-zA-Z0-9]{10})(?:[/?]|$)")

1
  • ; and , are just different list separating symbols. ; is used in locales where comma is used for radix point like most European languages. It's unrelated to Google sheet
    – phuclv
    Dec 17, 2018 at 5:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .