Forum Discussion

JeffG4710's avatar
JeffG4710
Copper Contributor
Feb 16, 2023
Solved

Excel Formula Problem

I have a variable string of characters that I want to change into another string.  The characters and delimiters are somewhat variable but there is a pattern.   I have a string that looks like the ...
  • HansVogelaar's avatar
    HansVogelaar
    Feb 17, 2023

    JeffG4710 

    In older versions of Excel:

     

    =SUBSTITUTE(TRIM(LEFT(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(D2,"istockphoto.com/photo","gettyimages.com/detail/photo"),"-gm","-royalty-free-image/"),"-",REPT(" ",255)),LEN(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(D2,"istockphoto.com/photo","gettyimages.com/detail/photo"),"-gm","-royalty-free-image/"),"-",REPT(" ",255)))-255))," ","-")

Resources