DETECTLANGUAGE function
Identifies the language of a specified text.
Text · Microsoft 365 · Guided Excel example
Where can you use it?
Data preparation and reporting teams. Use this group to clean, split or reformat IDs, names and descriptions before using them in reports.
Scenario in the workbook
Identify the language code of full sentences. Isolated words shared across languages can be ambiguous.
A worked example from the workbook
| Row | A |
|---|---|
| 6 | Input |
| 7 | Payment received for the latest invoice. |
| 8 | Bu fatura bugün ödendi. |
| 9 | Cette facture est déjà payée. |
Record 1
=DETECTLANGUAGE(A7)Illustrative outputen
See the inputs and instructions for all 3 examplesWorked examples
Identify the language code of full sentences. Isolated words shared across languages can be ambiguous.
Column F provides expressions as text. Satisfy the stated requirements, then paste into an empty Excel cell and compare with column G. The result was not verified in desktop Excel here.
| Row | A |
|---|---|
| 6 | Input |
| 7 | Payment received for the latest invoice. |
| 8 | Bu fatura bugün ödendi. |
| 9 | Cette facture est déjà payée. |
| Trial | Expression | Sample output |
|---|---|---|
| Record 1 | =DETECTLANGUAGE(A7) |
en |
| Record 2 | =DETECTLANGUAGE(A8) |
tr |
| Record 3 | =DETECTLANGUAGE(A9) |
fr |
If the result is missing
Short fragments can be ambiguous. Try a full sentence.