How to use the CONVERT function in Excel (units)
In Excel for Microsoft 365 / Excel 2021–2024 (verified 2026-10-24), type =CONVERT(number, "from_unit", "to_unit") — for example =CONVERT(100,"km","mi") or =CONVERT(A2,"C","F").
Unit codes are case-sensitive strings from Microsoft’s list (weight, distance, temperature, time, pressure and more). Wrong codes return #N/A.
Applies to Excel for Microsoft 365, Excel 2021/2024, Excel for Mac and Excel for the web. Google Sheets has no identical CONVERT; use custom math or Apps Script there.
Convert units with a formula
Write CONVERT
- Click the result cell.
- Enter
=CONVERT(A2,"km","mi")replacing A2 and the unit codes you need. - Press Enter — Excel returns the converted number.
Common unit pairs
- Distance:
"km"↔"mi","m"↔"ft". - Temperature:
"C"↔"F"↔"K". - Weight:
"g"/"kg"↔"lbm".
Reuse across a column
- Put the source value in column A and fill CONVERT down.
- Keep unit codes in helper cells and reference them if you switch often.
- Format the result (decimal places) after converting.
Our take: prefer CONVERT over hand math
Hard-coded factors are easy to mistype and hard to audit. CONVERT keeps the unit pair visible in the formula so reviewers can check it.
If it fails
- #N/A: unit code typo or incompatible pair.
- #VALUE!: first argument is text — coerce with VALUE.
- Case errors: use exact codes like
"mi"not"Mi". - Need currency FX: CONVERT is physical units, not exchange rates.
Frequently asked questions
What does Excel CONVERT do?
It converts a number from one measurement unit to another.
Is CONVERT case-sensitive?
Yes — unit strings must match Microsoft’s codes exactly.
Can CONVERT change currencies?
No — it is for physical units, not money.
Does CONVERT work on Excel for the web?
Yes.
Where is the full unit list?
Microsoft Support documents every from/to code CONVERT accepts.