-1

example i have data in colum https://www.mybookStore.com/images/products/80/1020/40422/2/279/howtocookegg8.jpg https://www.mybookStore.com/images/products/80/1020/40422/2/279/howtocookegg9.jpg

i need the formula that can go backward one or two directory in url link, so the result would be:

https://www.mybookStore.com/images/products/80/1020/40422/2/howtocookegg8.jpg https://www.mybookStore.com/images/products/80/1020/40422/howtocookegg9.jpg

i read article about relative file paths: Starting with "/" returns to the root directory Starting with "../" moves one directory backwards Starting with "../../" moves two directories backwards

How to do that on google sheets formula or script, assume i have in A1: https://www.mybookstore.com/images/products/80/1020/40422/2/279/howtocookegg8.jpg

so column B1: would be https://www.mybookstore.com/images/products/80/1020/40422/2/howtocookegg8.jpg

in C1: https://www.mybookstore.com/images/products/80/1020/40422/howtocookegg8.jpg

i need formula or script that can do that, please help, thanks you.

New contributor
extreemblank is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
  • The links in your questions are bad. Please share a copy of your spreadsheet and include an example of the outcome that you are trying to achieve. – Tedinoz Nov 30 at 7:33
  • sorry i am newb for this situation, i read article about relative file paths: Starting with "/" returns to the root directory Starting with "../" moves one directory backwards Starting with "../../" moves two directories backwards How to do that on sheets. assume i have in A1: www.mybookstore.com/images/products/80/1020/40422/2/279/howtocookegg8.jpg so column B1: would be www.mybookstore.com/images/products/80/1020/40422/2/howtocookegg8.jpg. C1: www.mybookstore.com/images/products/80/1020/40422/howtocookegg8.jpg. i need formula or script that can do that, thanks – extreemblank Nov 30 at 17:58
0

mmm, ok, (using formulas) first thing you need to remove the file name from the path, then identify how many "/" you got and count the characters so you know how many characters are from the prev-to-last "/", then use =left()-amount_o_chars and then add back the file name. I suggest you do things step by step. Each step in a different cell using the data from the previous one, once you achieve your goal, integrate the formulas into the last cell. It can be done, but you have to spend a long time playing with Find(), left(), right(), and any other text formula you can use.

Your Answer

extreemblank is a new contributor. Be nice, and check out our Code of Conduct.

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.