Title Case

Add title Case or headline capitalization to your google sheets as a native function.

Code.gs

/**
 * @customfunction
 */
function titleCase(anyText) {
  var words = anyText.split(' ');
  var capitalizedWords = words.map(function(word) {
    return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();
  });
  return capitalizedWords.join(' ');
}