DETECTLANGUAGE Function
DETECTLANGUAGE tells you what language a piece of text is written in.
Syntax
Parameters
| Parameter | Description | Required |
|---|---|---|
| text | The text whose language should be detected. Can be a string literal or a cell reference. | Required |
Basic Example
Detect the language of a sentence
=DETECTLANGUAGE('Hola, mundo')The text 'Hola, mundo' is detected as Spanish, returning the code 'es'.
Advanced Examples
Example 1: Detect language for a column
Customer support ticketsFind the language of each support ticket in a list
=ARRAYFORMULA(DETECTLANGUAGE(A2:A100))How DETECTLANGUAGE Works
DETECTLANGUAGE analyzes the provided text and returns the most likely ISO 639-1 language code. It uses the same language detection service as Google Translate.
Important Notes & Limitations
DETECTLANGUAGE is Google Sheets only and has no native Excel equivalent.
Short texts or mixed languages may be detected incorrectly.
It returns only the language code, not the language name or confidence score.
Common Errors & Fixes
#VALUE! errorThe input is empty or not valid text.Fix: Ensure the cell contains text and is not blank.
Wrong language codeThe text is too short or mixed with another language.Fix: Provide more text for better detection accuracy.
Download Practice File
DETECTLANGUAGE
detectlanguagePractice DETECTLANGUAGE with Real Data
Download a sample CSV file with pre-populated data and practice exercises for the DETECTLANGUAGE function. Works in both Excel and Google Sheets.
File format: CSV (comma-separated values) - opens in Excel, Google Sheets, and all spreadsheet apps