+ Reply to Thread
Results 1 to 7 of 7

Thread: Help with tricky formula needed

  1. #1
    Registered User
    Join Date
    10-01-2005
    Posts
    3

    Help with tricky formula needed

    I have data in column A that I need to get over to column B.

    For example column A may contain the number 70. I need that number to translate into a web url in colum B in format http://abc.com/thumbs/000/000/070/small.jpg

    For example if I had the number 17825, the corresponding entry in colum B would need to look like http://abc.com/thumbs/000/017/825/small.jpg

    150555 would be http://abc.com/thumbs/000/150/555/small.jpg and so on....

    Largest numbers are 6 figures. Can anyone help me with a formula to do this?

  2. #2
    Forum Guru
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    5,359
    Hi

    If your number is in A2, try
    =HYPERLINK("http://abc.com/thumbs/000/" & LEFT(TEXT(A2,"000000"),3) & "/" & RIGHT(TEXT(A2,"000000"),3) & "/small.jpg")

    rylo

  3. #3
    Valued Forum Contributor
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    2007
    Posts
    933
    Hi cashbagg,

    Assuming your data starts at cell A2 (change as required), put the following formula in cell B2 and copy down as required:

    =HYPERLINK(A2,"http://abc.com/thumbs/000/"&IF(LEN(A2)=6,LEFT(A2,3),IF(LEN(A2)=5,"0"&LEFT(A2,2),IF(LEN(A2)=4,"00"&LEFT(A2,1),"000")))&"/"&IF(OR(LEN(A2)=6,LEN(A2)=5,LEN(A2)=4,LEN(A2)=3),MID(A2,LEN(A2)-2,3),IF(LEN(A2)=2,"0"&A2,IF(LEN(A2)=1,"000"&A2,"000")))&"/small.jpg")

    HTH

    Robert

  4. #4
    Forum Guru shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2007, 2010
    Posts
    25,777
    Cashbagg,

    Please read our Forum Rules about thread titles before starting your next thread.

  5. #5
    Forum Moderator daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2007
    Posts
    10,057
    Try

    =HYPERLINK("http://abc.com/thumbs/000/"&TEXT(A2,"000\/000")&"/small.jpg")

  6. #6
    Registered User
    Join Date
    10-01-2005
    Posts
    3
    Robert you are a scholar and a gentleman!

    Worked like a charm,

    Thanks.

  7. #7
    Valued Forum Contributor
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    2007
    Posts
    933
    Robert you are a scholar and a gentleman!
    - despite the rumours

    Thanks for the feedback, but I'd actually use either rylo's or daddylonglegs's formula as they're far more succinct and easier to understand / follow.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.2.0