Convert text to sentence case
=LET(
base,
ARRAYFORMULA(
TRIM(
JOIN(
"",
UPPER(LEFT(SPLIT(REGEXREPLACE(text, "[.!?]\s*", "$0π’"), "π’"), 1)) &
LOWER(MID(SPLIT(REGEXREPLACE(text, "[.!?]\s*", "$0π’"), "π’"), 2, 1000000))
)
)
),
REGEXREPLACE(
REGEXREPLACE(base, "(^|[^A-Za-z])i(['β])", "$1I$2"),
"(^|[^A-Za-z])i([^A-Za-z]|$)", "$1I$2"
)
)This function is designed to convert a string of text into sentence case, where the first letter of each sentence is capitalized, and all other letters are lowercase. This function is particularly useful for formatting titles, descriptions, or any text data that requires standardization before presentation or further processing. To use it, simply input the text string or cell reference containing the text, and the function will automatically adjust the casing to reflect proper sentence structure, making it easier to achieve a uniform and professional look across your data.
Use the inputs below to create SENTENCE_CASE as a reusable custom function in Google Sheets.
Learn how to add custom functions to Google SheetsSENTENCE_CASE
Convert text to sentence case
=LET( base, ARRAYFORMULA( TRIM( JOIN( "", UPPER(LEFT(SPLIT(REGEXREPLACE(text, "[.!?]\s*", "$0π’"), "π’"), 1)) & LOWER(MID(SPLIT(REGEXREPLACE(text, "[.!?]\s*", "$0π’"), "π’"), 2, 1000000)) ) ) ), REGEXREPLACE( REGEXREPLACE(base, "(^|[^A-Za-z])i(['β])", "$1I$2"), "(^|[^A-Za-z])i([^A-Za-z]|$)", "$1I$2" ) )
text
The text string or cell reference containing the text to be converted to sentence case.
A1
Other functions in the same category: Text Manipulation & Formatting
Removes HTML tags and decodes a few common HTML entities
Return uppercase initials from a name or phrase
Normalize whitespace without altering punctuation or letter casing
Removes diacritics from text (for example Γ© to e, ΓΌ to u)
Extracts text between two delimiters
Returns the Levenshtein edit distance between two text values
Named functions enable the creation of custom, reusable formulas that mimic built-in functions, streamlining calculations and data manipulations. These functions simplify complex formulas, making spreadsheets more readable and less prone to errors. By encapsulating intricate logic within a single function call, they enhance consistency across your data. Utilizing named functions reduces the need to write lengthy formulas repeatedly, thereby improving workflow efficiency and productivity in data analysis and management.
Download and import β fastest way to add the function but does not include argument descriptions and examples
Follow these simple steps to download and import a function into your spreadsheet. This method is the quickest and easiest way to add the named function to your Google Sheets document, but will not include the argument description and examples.
Once added, the function will be ready to use in your document like any other built-in function. Simply type the function name and provide the required inputs to use it in your calculations.
Copy and paste β copy and paste each property one at a time
Follow these simple steps to integrate a custom named function into your spreadsheet:
Once added, the function will be ready to use in your document like any other built-in function. Simply type the function name and provide the required inputs to use it in your calculations.