DETECTLANGUAGE function

Tells you which language some text is written in, as a language code (for example "fr").

Works in desktop Excel only

Syntax

=DETECTLANGUAGE(text)

How to use DETECTLANGUAGE in Excel, step by step

DETECTLANGUAGE doesn’t run in a web practice sheet because it uses Microsoft’s online translation service. Follow these steps in Excel itself.

You’ll need

  • Microsoft 365 with the newest Excel features
  • An internet connection
  1. Put text in a cell. In A1 type Bonjour tout le monde.
  2. Detect the language. In B1 type =DETECTLANGUAGE(A1). It returns "fr".
  3. Combine with TRANSLATE. =TRANSLATE(A1,DETECTLANGUAGE(A1),"en") translates whatever language it finds into English.

Example

=DETECTLANGUAGE("Bonjour tout le monde")

Result: fr

Very short text can be detected wrongly.