DETECTLANGUAGE function
Tells you which language some text is written in, as a language code (for example "fr").
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
- Put text in a cell. In A1 type Bonjour tout le monde.
- Detect the language. In B1 type =DETECTLANGUAGE(A1). It returns "fr".
- 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.