2

I have some multiple images in Excel file which are separated with | For example:

http://s3.supplyhouse.com/images/products/small/gt2700-15-3.jpg|http://s3.supplyhouse.com/images/products/small/gt2700-15-4.jpg|http://s3.supplyhouse.com/images/products/small/gt2700-15-1.jpg

I want to extract the last image from the cell.

I need to configure =RIGHT formula that will remove all text before last | character.

In some cells there are | characters 3 times, somewhere, 2, somewhere 4. So I need to find the last one and delete all characters before it, I don't need something like "Find 3rd | character and remove everything before it".

2

4 Answers 4

3

I have combined some excel formulas and made this one which works:

=RIGHT($D1,LEN($D1)-SEARCH("^^",SUBSTITUTE(D1,"|","^^",LEN(D1)-LEN(SUBSTITUTE(D1,"|","")))))

If someone think that something is missing, please comment.

Sign up to request clarification or add additional context in comments.

Comments

3

To get just the image filename,

=TRIM(RIGHT(SUBSTITUTE(A2,"/",REPT(" ",LEN(A2))),LEN(A2)))

To get the full link,

=TRIM(RIGHT(SUBSTITUTE(A2,"|",REPT(" ",LEN(A2))),LEN(A2)))

enter image description here

1 Comment

I believe this is the correct answer (and the shortest formula).
0

Cleaner way to do this would be to have 1 formula to identify image breaks and then another formula to give the picture string. Then just use an offset function to capture the last image for your answer.

Note:I inserted your picture string into A1

Column 1: Image #

Column 2: String for each picture =IFERROR(SEARCH(".jpg",$A$1),"")

Column 3: Text for picture: =IFERROR(LEFT($A$1,B4+3),"")

2 Comments

Perhaps this is a better design, but you are not addressing the question which was asked.
It would if you use the offset. So if you use counta on either column 2 or 3, it will tell you how many pictures are in the string. You can then use offset to only grab the last picture or string while ignoring everything else
0

Col A - data to be processed

Col b - =TRIM(IF(ISERROR(FIND("-",A2)),"",MID(A2,FIND(CHAR(1),SUBSTITUTE(A2,"-",CHAR(1),LEN(A2)-LEN(SUBSTITUTE(A2,"-","")))),255)))

Col c - =SUBSTITUTE(A5,B5,"")

Col c will be your output column

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.