FormulaCraft

DETECTLANGUAGE

DETECTLANGUAGE analyzes the text in a cell and returns a BCP-47 language code (e.g., "en" for English, "fr" for French) based on Google's language detection service. It is useful for cleaning multilingual datasets, routing content for translation, or filtering rows by language.

Excel
=DETECTLANGUAGE(A2)
Google Sheets
=DETECTLANGUAGE(A2)

Try it with your data

Edit the grid or formula, then run it through a real spreadsheet engine — no signup.

Sample data — click any cell to edit

Runs server-side · free · no signup

How it works

  1. 1Enter a reference to the cell containing the text whose language you want to detect.
  2. 2The function returns a two-letter (or longer) BCP-47 language code such as "en", "es", or "zh-TW".
  3. 3Use the result with IF or FILTER to route rows to different workflows depending on the detected language.

Need a version for your data?

Try: “Detect what language each customer review is written in

Related

Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.

Last reviewed: