How to use the CONVERT function in Excel (units)

Updated · DeskHowTo

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.

Jump to

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

  1. Click the result cell.
  2. Enter =CONVERT(A2,"km","mi") replacing A2 and the unit codes you need.
  3. Press Enter — Excel returns the converted number.

Common unit pairs

  1. Distance: "km" ↔ "mi", "m" ↔ "ft".
  2. Temperature: "C" ↔ "F" ↔ "K".
  3. Weight: "g" / "kg" ↔ "lbm".

Reuse across a column

  1. Put the source value in column A and fill CONVERT down.
  2. Keep unit codes in helper cells and reference them if you switch often.
  3. 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.

Sources checked: Microsoft Support: CONVERT function. Verified October 2026.