Home > Net >  Excel - Trimming Part of the URL to use as a title in the Hyperlink Function
Excel - Trimming Part of the URL to use as a title in the Hyperlink Function

Time:09-02

I'm putting together a spreadsheet of PlayStation Store URLs in Google Docs, I need to grab the Title ID (CUSA), the Title Number (00473) and what I'm assuming is the package name? (LBP3GAME00000001) from the URL to use as a title in the =HYPERLINK() function, Example URL (https://store.playstation.com/en-us/product/UP9000-CUSA00473_00-LBP3GAME00000001)

What I am attempting to format the URL as: CUSA00473 - LBP3GAME00000001

(I do already have a cell with the string "UP9000-CUSA00473_00-LBP3GAME00000001" already in my sheet)

I've seen this post where someone was using =MID() to extract text located after bm_placement=, would this work for my current situation and would someone be able to explain it to me please? Thanks.

CodePudding user response:

You can use the following on your source link:

=HYPERLINK(B1,REGEXREPLACE(B1,"^.*-([^_] )_\d ","$1"))
  • Related