How do I create URLs in Excel based on data in another cell?

calendar_today Asked May 3, 2013
thumb_up 11 upvotes
history Updated April 16, 2026

Question posted 2013 · +5 upvotes

Consider the following Excel sheet:

     A             B                       C
1 ASX:ANZ      ANZ:ASX       http://www.site.com/page?id=ANZ:ASX
2 DOW:1234     1234:DOW      http://www.site.com/page?id=1234:DOW
3 NASDAQ:EXP   EXP:NASDAQ    http://www.site.com/page?id=EXP:NASDAQ

I need a formula for the B and the C column. In the B column I need the values of the A column to be split on : and the two resulting parts to be reversed, see the three examples. In the C column, I need the result from B to be added to a (hardcopy) URL (http://www.site.com/page?id=) to form a link.

Who can help me out? Your help is greatly appreciated!

Accepted answer +11 upvotes

Alright. I don’t normally spoon feed answers but here you go.

In B:

=MID(A1, FIND(":", A1, 1)+1, LEN(A1) - FIND(":",A1,1)) & ":"&MID(A1,1,FIND(":",A1,1)-1)

In C:

=HYPERLINK("http://www.site.com/page?id="&B1)

2 code variants in this answer

  • Variant 1 — 1 lines, starts with =MID(A1, FIND(":", A1, 1)+1, LEN(A1) - FIND(":",A1,1)) & ":…
  • Variant 2 — 1 lines, starts with =HYPERLINK("http://www.site.com/page?id="&B1)

Top excel Q&A (6)

+11 upvotes ranks this answer #67 out of 167 excel solutions on this site .