CONVERT function
CONVERT converts between units of length, weight, time, temperature, volume and more. It is a quick way to avoid hard-coded conversion factors, and unit codes are case-sensitive.
Example
Read it as a sentence: convert 1 kilometer into meters, which gives 1000.
A
B
C
D
1
1000
2
3
Syntax
CONVERT(number, from_unit, to_unit)
-
number(required) - The amount to convert.
-
from_unit(required) - The unit it is currently in, as a code like "km" or "lbm".
-
to_unit(required) - The unit to convert to.
Returns: The converted amount.
What Excel actually returns
Each formula below was run in desktop Excel. The result is exactly what the cell showed, errors included.
| Formula | Excel shows | Case |
|---|---|---|
=CONVERT(1,"mi","km") | 1.609344 | 1 mi to km |
=CONVERT(100,"C","F") | 212 | 100 C to F |
=CONVERT(-300,"C","K") | -26.85 | Temperature -300 C to K (negative K) |
=CONVERT(1,"km","m") | 1000 | Prefix k + m |
=CONVERT(1,"kibyte","byte") | 1024 | Binary prefix ki |
=CONVERT(1,"m2","ft2") | 10.76391042 | Area m2 to ft2 |
=CONVERT(1,"KM","m") | #N/A | Case-sensitive "KM" |
=CONVERT(1,"m","kg") | #N/A | Incompatible units |
Watch out for
- Unit codes are case-sensitive.
- Units must be in the same family or you get #N/A.
Where it works
- Excel
- CONVERT is in every version of Excel from 2007 on.
- Google Sheets
- Same name, but behaves differently. Sheets CONVERT supports a broadly similar but not identical set of unit codes.
Part of Engineering functions. Every result on this page was measured in desktop Excel, build 16.0.20527. Last updated .