Convert Units with CONVERT

Excel Formulas › Math

All versionsCONVERT

The CONVERT function changes a value from one unit to another — miles to kilometers, pounds to kilograms, Fahrenheit to Celsius, hours to seconds — using built-in unit codes, so you never hunt for a conversion factor again.


Quick formula: to convert 5 miles to kilometers:
=CONVERT(5, "mi", "km")
The arguments are the value, the from unit code, and the to unit code. CONVERT(5,"mi","km") ≈ 8.05.

Functions used (tap for the full reference guide):

The example

Common everyday conversions.

AB
1ConversionResult
25 mi → km8.05
310 lbm → kg4.54
4100 F → C37.78

The formula

Miles to kilometers:

=CONVERT(5, "mi", "km") // ≈ 8.05

How it works

Three arguments: value, from-unit, to-unit:

  1. Pass the number, then the from and to unit codes as text — e.g. "mi" miles, "km" kilometers.
  2. CONVERT only works within the same category — distance to distance, weight to weight. It won’t convert miles to pounds.
  3. Common codes: distance "mi" "km" "m" "ft" "in"; weight "lbm" "kg" "g"; temperature "F" "C" "K"; time "hr" "mn" "sec" "day".
  4. Unit codes are case-sensitive — "K" is Kelvin, "k" is a kilo prefix.

Metric prefixes work too: CONVERT understands prefixes like "k" (kilo) and "c" (centi) on metric units — =CONVERT(1, "m", "cm") gives 100. Great for scaling within the metric system.

Try it: interactive demo

Live demo

Convert a value between a few common units.

Result:

Variations

Temperature

Fahrenheit to Celsius:

=CONVERT(100, "F", "C")

Time

Hours to seconds:

=CONVERT(2, "hr", "sec")

Metric prefixes

Meters to centimeters:

=CONVERT(1, "m", "cm")

Pitfalls & errors

#N/A from a wrong code or mismatched category. Converting "mi" to "kg" (distance to weight) errors, as does a misspelled unit. Use the exact codes.

Codes are case-sensitive. Weight pounds is "lbm", not "lb"; Kelvin is "K". Check the documented code list.

Some niche units vary by version. Most common units are universal, but a few specialized ones were added in later Excel releases.

Practice workbook

📊
Download the free Convert Units with CONVERT practice workbook
Distance/weight/temperature/time conversions with results shown, the metric-prefix variant, plus 4 challenges with answers. No sign-up required.

Frequently asked questions

How do I convert units in Excel?
Use =CONVERT(value, from_unit, to_unit), e.g. =CONVERT(5, "mi", "km") converts 5 miles to kilometers. The unit codes are text and case-sensitive.
What unit codes does CONVERT use?
Common ones include mi/km/m/ft/in for distance, lbm/kg/g for weight, F/C/K for temperature, and hr/mn/sec for time. Conversions must stay within the same category.
Why does CONVERT return #N/A?
The units are misspelled or from different categories (e.g. distance to weight). Use exact, case-correct codes and convert within the same measurement type.

Stop fighting formulas. Learn them in a day.

This recipe is one of hundreds of real-world formulas we teach. Our Excel Formulas & Functions class covers lookups, logic, text, and dynamic arrays hands-on — live in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.

See the Formulas & Functions Class

Related formulas: Round to the nearest X · Nth root & powers · Convert text to a real date

Function references: CONVERT