-1

Say I get a string like this B01AVAF3AK-40 / B01AVAF5Q2-36. I would like to copy over any ASIN's into new cells on parallel columns.

I have been using a combination of =REGEXEXTRACT(A2, "(B[a-zA-Z0-9]{9}).*(B[a-zA-Z0-9]{9})") and =HYPERLINK(CONCATENATE("https://www.amazon.com/dp/product/",C2),C2).

The problem with this approach is: 1) I can only get two ASIN's from one string. 2) I don't have a single formula that does both regex matching and adds a hyperlink. How would I solve this in Google Sheets?

Additionally how would this be done using Excel?

My spreadsheet

Avi Kaminetzky
  • 1,489
  • 2
  • 19
  • 42

1 Answers1

1

This works perfectly with Google Sheets (added solution to spreadsheet):

=ARRAYFORMULA(HYPERLINK("https://www.amazon.com/dp/product/" & REGEXEXTRACT(SPLIT(A2, "/"), "(B[a-zA-Z0-9]{9})"), REGEXEXTRACT(SPLIT(A2, "/"), "(B[a-zA-Z0-9]{9})")))

Avi Kaminetzky
  • 1,489
  • 2
  • 19
  • 42