Forum Discussion
MeredithMoore5
7 years agoQrew Assistant Captain
Any links to any help articles or formulas would also be helpful. I have found lots of articles on different solutions, and none seem to work. :(
- _anomDiebolt_7 years agoQrew EliteThis can't be done with a conventional formula. You have to use JavaScript. However, there are minor details to resolve as to what that JavaScript should be because it isn't clear what the script should do in all cases. Your third example introduces the possibility that numbers may be included in the source string in which case there will be a "-" character in the output string:
var string = "m2mxcoordinatoroperationsadministrative".toLowerCase();
This script removes the spaces between characters (although they are very useful during debugging). You still have to accommodate all possible character values that could possibly be inputs with additional logic.
string = string.replace(/./g, function(c) {
var charCode = c.charCodeAt(0);
if (charCode == 32) {
return 0;
} else {
return c.charCodeAt(0) - 96;
}
});
//"13-46132431515184914120151815165181209151419141391491920181209225"
Once you get the script working from the console you can implement it with (1) the IOL technique or (2) the OEH (On Error HTML) technique using the OEH Machine which automatically creates the formula (ie no code page):