The DETECTLANGUAGE function in Google Sheets is an invaluable tool designed to automatically identify the language of a given text. This function is particularly useful in a global environment where data may come from diverse linguistic backgrounds, allowing users to manage and analyze multi-language datasets efficiently.
Syntax
DETECTLANGUAGE(text)
- text: The text string or cell reference for which the language detection is to be performed.
Example #1
=DETECTLANGUAGE("Hola, ¿cómo estás?")
This function call checks the language of the text “Hola, ¿cómo estás?” and would return “es” for Spanish.
Example #2
=DETECTLANGUAGE(A1)
Assuming cell A1 contains the text “Bonjour tout le monde”, this function would detect the language as “fr” for French.
Example #3
=DETECTLANGUAGE("Hello, how are you?")
This function checks the text “Hello, how are you?” and would return “en” indicating English as the detected language.
Error handling
- N/A: Occurs when the input text cannot be identified as a valid language.
- VALUE: Indicates that the input provided is not of the expected text format or is empty.
- ERROR: This error arises from an internal issue or an unsupported text format.