ZetCode

Excel CONVERT Function

last modified October 5, 2026

The CONVERT function converts a number from one measurement system to another. It handles distance, area, volume, mass, time, pressure, force, energy, power, magnetism, temperature, speed, and information units. This tutorial provides a comprehensive guide to using the CONVERT function with detailed examples. You'll learn the syntax, the supported unit codes, and the mistakes that produce errors.

CONVERT Function Basics

The CONVERT function changes a measurement from one unit to another. Every conversion stays inside a single measurement category: distance converts to distance, mass to mass, and so on. Mixing categories returns an error. The syntax requires three arguments.

Component Description
Function Name CONVERT
Syntax =CONVERT(number, from_unit, to_unit)
Arguments Number to convert, original unit, target unit
Return Value Converted measurement in new units

This table breaks down the essential components of the CONVERT function. The function requires a numeric value and two unit codes supplied as text strings.

Argument Meaning
number The value to convert. It can be a literal, a cell reference, or an expression that returns a number. Text that cannot be read as a number produces a #VALUE! error.
from_unit The unit of number, written as a case-sensitive text code such as "m", "lbm", or "C".
to_unit The unit of the result, written in the same style. It must belong to the same measurement category as from_unit.

Both unit arguments must be enclosed in quotation marks. If a unit does not exist, or if the two units belong to different categories, the function returns #N/A.

Basic CONVERT Example

This example demonstrates converting inches to centimeters using the CONVERT function.

A B
10
=CONVERT(A1, "in", "cm")

The table shows a length in inches in cell A1 and the conversion formula in B2 that converts it to centimeters. Because 1 inch equals exactly 2.54 centimeters, the result is 25.4 cm.

Basic CONVERT formula
=CONVERT(10, "in", "cm")

This formula converts 10 inches to centimeters and returns 25.4. Note that unit codes must be enclosed in quotation marks.

Case-Sensitive Unit Codes

Unit names and prefixes are case-sensitive. "m" is the meter, but "M" is the mega prefix; "C" is degrees Celsius, but "c" is the thermodynamic calorie; "K" is kelvin, but "k" is the kilo prefix. A single wrong letter changes the meaning of a formula or produces #N/A.

Code Meaning Common Mistake
"m" meter "M" is the mega prefix, not meter
"C" degree Celsius "c" is the thermodynamic calorie
"K" kelvin "k" is the kilo prefix
"l" or "L" liter Both forms are valid; "lt" also works
"in" inch "inch" is not a valid code
"lbm" pound mass "lb" is not a valid code
"mn" or "min" minute "m" alone means meter
"HP" or "h" horsepower "hp" is not a valid code

When in doubt, copy the unit code from Excel's formula autocomplete or from the official documentation instead of typing it from memory.

Temperature Conversion

Temperature conversion is different from the other categories because the scales do not share a zero point. CONVERT applies the offset as well as the ratio, so 0 degrees Celsius returns 32 degrees Fahrenheit.

A B
100
=CONVERT(A1, "C", "F")

The table shows a temperature value in Celsius in cell A1 and the conversion formula in B2 that converts it to Fahrenheit. The result is 212 degrees Fahrenheit.

Temperature conversion
=CONVERT(A1, "C", "F")

This formula converts the Celsius value in A1 to Fahrenheit. Temperature conversions use "C" for Celsius, "F" for Fahrenheit, "K" for kelvin, "Rank" for degrees Rankine, and "Reau" for degrees Reaumur. The conversion is affine: it multiplies by the scale ratio and then adds an offset, which is why 0 C is 32 F rather than 0 F.

Formula Result
=CONVERT(0, "C", "F") 32
=CONVERT(100, "C", "F") 212
=CONVERT(68, "F", "C") 20
=CONVERT(0, "C", "K") 273.15

Weight and Mass Conversion

This example demonstrates converting pounds to kilograms, a common mass conversion needed in many applications.

A B
150
=CONVERT(A1, "lbm", "kg")

The table shows a mass in pounds (lbm stands for pound-mass) in cell A1 and the conversion to kilograms in B2. Because 1 pound-mass equals exactly 0.45359237 kilograms, the result is approximately 68.0389 kg.

Weight conversion
=CONVERT(A1, "lbm", "kg")

This formula converts pounds (lbm) to kilograms (kg). Other mass units include "g" for gram, "ozm" for ounce mass, "sg" for slug, "u" for atomic mass unit, "grain", "stone", and "ton". Do not confuse "ozm" (ounce mass) with "oz", which is the fluid ounce used for volume.

Volume Conversion

Volume conversion is useful in cooking, chemistry, and other fields. This example converts US gallons to liters.

A B
5
=CONVERT(A1, "gal", "l")

The table demonstrates converting 5 gallons to liters. Because the US liquid gallon equals exactly 3.785411784 liters, the result is approximately 18.9271 liters.

Volume conversion
=CONVERT(A1, "gal", "l")

This formula converts gallons (gal) to liters (l). The unit "gal" is the US liquid gallon; the imperial gallon has its own code, "uk_gal", and equals 4.54609 liters. Other volume units include "tsp" for teaspoon, "tbs" for tablespoon, "oz" for fluid ounce, "cup", "pt" for US pint, "uk_pt" for UK pint, "qt" for quart, and "m3" for cubic meter. The liter may be written as "l", "L", or "lt".

Energy Conversion

Energy conversion is important in physics and engineering. This example converts joules to calories.

A B
1000
=CONVERT(A1, "J", "cal")

The table shows 1000 joules being converted to calories. Excel's "cal" is the International Table (IT) calorie, equal to exactly 4.1868 joules, so the result is approximately 238.8459 calories.

Energy conversion
=CONVERT(A1, "J", "cal")

This formula converts joules (J) to IT calories (cal). The thermodynamic calorie has a different code, "c", and equals exactly 4.184 joules, so =CONVERT(1000, "J", "c") returns approximately 239.0057. Other energy units include "eV" for electron volt, "Wh" for watt-hour, "HPh" for horsepower-hour, "flb" for foot-pound, "e" for erg, and "BTU" for British thermal unit. Since 1 watt-hour equals 3600 joules, =CONVERT(1, "Wh", "J") returns 3600.

Time Conversion

Time conversions use exact, familiar ratios. The minute code is "mn" (or "min"), and the second code is "sec" (or "s").

Formula Result
=CONVERT(1, "day", "hr") 24
=CONVERT(1, "day", "sec") 86400
=CONVERT(1, "hr", "mn") 60
=CONVERT(90, "mn", "hr") 1.5
=CONVERT(1, "yr", "day") 365.25

The year "yr" is treated as 365.25 days, so the average length of a leap year is built in. This is worth remembering when a time conversion looks slightly off by a quarter of a day.

Common Conversion Examples

The following table collects exact factors for the conversions that appear most often in spreadsheets.

Conversion Formula Result
Inches to centimeters =CONVERT(1, "in", "cm") 2.54
Feet to meters =CONVERT(1, "ft", "m") 0.3048
Yards to meters =CONVERT(1, "yd", "m") 0.9144
Miles to kilometers =CONVERT(1, "mi", "km") 1.609344
Pounds to kilograms =CONVERT(1, "lbm", "kg") 0.45359237
Ounces to grams =CONVERT(1, "ozm", "g") 28.349523125
US gallons to liters =CONVERT(1, "gal", "l") 3.785411784
Imperial gallons to liters =CONVERT(1, "uk_gal", "l") 4.54609
Watt-hours to joules =CONVERT(1, "Wh", "J") 3600
IT calories to joules =CONVERT(1, "cal", "J") 4.1868
Atmospheres to pascals =CONVERT(1, "atm", "Pa") 101325
Celsius to Fahrenheit =CONVERT(100, "C", "F") 212

Supported Unit Categories

The CONVERT function supports the measurement categories in this table. Each has specific unit codes that must be used exactly as defined.

Category Example Units
Weight and Mass "g", "kg", "lbm", "ozm", "sg", "stone", "ton"
Distance "m", "mi", "in", "ft", "yd", "ang", "ly", "parsec"
Area "m2", "ft2", "in2", "mi2", "ha", "ar"
Time "yr", "day", "hr", "mn", "sec"
Pressure "Pa", "atm", "mmHg", "psi", "Torr"
Force "N", "dyn", "lbf"
Energy "J", "eV", "cal", "c", "Wh", "BTU"
Power "W", "HP", "PS"
Magnetism "T", "ga"
Temperature "C", "F", "K", "Rank", "Reau"
Volume "tsp", "tbs", "oz", "cup", "gal", "l", "m3"
Speed "m/s", "m/h", "mph", "kn", "admkn"
Information "bit", "byte"

Metric units accept decimal prefixes such as "k" (kilo), "c" (centi), and "m" (milli), so "km" is a kilometer and "mg" is a milligram. Prefixes are case-sensitive too, and not every unit accepts every prefix.

CONVERT Errors and Troubleshooting

Most CONVERT problems come from misspelled, mismatched, or incorrectly cased unit codes.

Cause Symptom Fix
Unit code does not exist #N/A error Use the exact code, for example "in" instead of "inch"
Units belong to different categories #N/A error Convert within one category, such as "kg" to "lbm"
Wrong letter case #N/A error or a different unit Match case exactly: "C" is Celsius, "c" is a calorie
Binary prefix on an unsupported unit #N/A error Remove the binary prefix or use a decimal prefix
The number argument is text #VALUE! error Provide a number, or convert the text with VALUE first
Unit code is not quoted #NAME? error Wrap both unit codes in double quotation marks
Too few or too many arguments Formula error on entry Supply exactly number, from_unit, and to_unit

The most common single mistake is assuming that a plain English word is a valid unit. "inch", "pound", "gallon", and "minute" are not codes; the codes are "in", "lbm", "gal", and "mn". When a conversion unexpectedly returns #N/A, check the spelling and case of both unit arguments before looking anywhere else.

Working and failing conversions
=CONVERT(10, "in", "cm")       ' 25.4, valid codes
=CONVERT(10, "inch", "cm")     ' #N/A, "inch" is not a code
=CONVERT(10, "kg", "m")        ' #N/A, different categories
=CONVERT("ten", "lbm", "kg")   ' #VALUE!, number is text
=CONVERT(10, "lb", "kg")       ' #N/A, "lb" is not a code

The CONVERT function is an essential tool for anyone working with multiple measurement systems in Excel. From simple distance conversions to complex engineering calculations, it provides accurate results quickly. The key to using it well is remembering that unit codes are case-sensitive text strings drawn from a fixed list, that both units must come from the same category, and that temperature is the one category where an offset is applied. Verify the unit codes against the official list and test a conversion with a known value before trusting it in a larger workbook.

Author

My name is Jan Bodnar, and I am a passionate programmer with extensive programming experience. I have been writing programming articles since 2007. To date, I have authored over 1,400 articles and 8 e-books. I possess more than ten years of experience in teaching programming.

List all Excel tutorials.