“Slugify” is a term for converting strings into URL slug format. A URL slug, or just slug in this article’s context, is the part of the URL that comes after the domain extension. In this guide, we’re going to show you how to slugify a string with Excel.
Periodically I run into the issue where I need to create a lot (thousands) of URLs from random strings of text, which may or may not include capital letters, spaces, hyphens, brackets, commas, etc.
Sometimes this is easiest done in a spreadsheet, so here’s an Excel function I baked up a couple of years ago that I use to solve the particular problem of slugifying/handling those URLs. It’s clunky, but functional*. Just replace “A2” with whatever cell you need to slugify, and voila.
*Only works for ASCII characters. Does not check for collisions!
Table of Contents
Features:
- Light Weight.
- Pure Excel Function.
- No External AddsOn.
- Work With Any Format Of Text.
- Fully Customizable.
Slugify Examples:
Web Page Title | SEO-friendly URL Slug |
---|---|
AS dsf a s1111#$ b’lue p”urple AsdoIj | as-dsf-a-s1111-blue-purple-asdoij |
Elon Musk considers move to Mars | elon-musk-considers-move-to-mars |
Fintech startups raised $34B in 2019 | fintech-startups-raised-dollar34b-in-2019 |
Shopify joins Facebook’s cryptocurrency Libra Association | shopify-joins-facebooks-cryptocurrency-libra-association |
What is a slug and how to optimize it? | what-is-a-slug-and-how-to-optimize-it |
Bitcoin soars past $33,000, its highest ever | bitcoin-soars-past-dollar33000-its-highest-ever |
Excel Function:
=LOWER(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(TRIM(A2)," ","-"),"'",""),"""",""),"/",""),"?",""),".",""),">",""),"<",""),",",""),";",""),":",""),"[",""),"]",""),"}",""),"[",""),"{",""),"|",""),"\",""),"+",""),"=",""),"~",""),"`",""),"!",""),"@",""),"#",""),"$",""),"%",""),"^",""),"&",""),"*",""),"(",""),")",""),"#",""),"'",""),"""",""),"---","-"),"--","-"))
Customization:
No need to customize it. Just copy-paste. Rest edit the code as per comments and need.
Troubleshooting the Errors:
Do it with concentration and patience. Check your all steps again and all codes or scripts. If you find any error you can contact us anytime via comment or better via email, We are always here to help you.
Final Words:
That’s all we have. We hope that you liked this article. If you have any problem with this code in your template then feel free to contact us with a full explanation of your problem. We will reply to you as time allows us If you have any doubts or problems please comment below. We are happy to help you! If you liked this article, Don’t forget to share this with your friends so they can also take benefit from it, and leave your precious feedback in our comment form below. Happy development, See you in the next article.
Be the first to write a comment.