This script for Google Spreadsheets allows you to generate slugs for your data such as might be used for creating unique urls.
Use it like this!
# | A | B | C |
---|---|---|---|
1 | a | b | slug |
2 | foo | baz bing | =slugify(A2:B4) |
3 | bar | BAZ | |
4 | FOO | baz-bing |
And you get this!
# | A | B | C |
---|---|---|---|
1 | a | b | slug |
2 | foo | baz bing | foo-baz-bing |
3 | bar | BAZ | bar-baz |
4 | FOO | baz-bing | foo-baz-bing-2 |
This should work for both single cells and arrays of cells including within the
ARRAYFORMULA