Detect language of text with DETECTLANGUAGE in Google Sheets

Use the DETECTLANGUAGE function to automatically return a language code (like en or fr) for text in a cell.

What the video covers

Identify the language of text in one or more cells using the built-in DETECTLANGUAGE function and return the language code (ISO-style, e.g., en, fr, es).

Watch the video on YouTube

Step-by-step instructions

  1. Select the result cell
    Click the cell where you want the detected language code to appear.
  2. Enter the function
    Type =DETECTLANGUAGE( and then click the cell that contains the text you want to analyze.
  3. Close and run
    Close the parentheses and press Enter. Google Sheets will return the language code for the referenced text.
  4. Apply to multiple rows
    Drag the result cell's fill handle down (or copy the formula) to apply DETECTLANGUAGE to other cells in the column; cell references will adjust automatically unless fixed.
  5. Use results
    Use returned language codes to filter, route to translation functions, or conditionally format rows based on language.

Watch the video

Video thumbnail for Detect language of text with DETECTLANGUAGE in Google Sheets Play tutorial

Watch on YouTube

Why it matters

When working with multilingual data, detecting the language automatically helps route translation, cleaning, or analysis without manual checking.

Check your result

If successful, the formula returns a short language code such as en for English, fr for French, or es for Spanish in the cell where you entered the function.

Troubleshooting

If the function returns an error or unexpected result: verify the referenced cell contains readable text (not blank or a formula error); try a different sample text to confirm behavior; ensure you have internet connectivity and that Google Sheets functions are available in your account. Short or ambiguous text may produce an incorrect or unspecified code.