ExcelReady
CourseMock testsFunction guidesBlog
Start freeStart learning for free
ExcelReady

Be Excel-ready before day one. Hands-on practice in your browser, with instant feedback.

Learn

  • Course
  • Mock tests
  • Function guides
  • Blog

Test prep

  • Excel level test
  • Excel test practice
  • Free screening quiz
  • Certificate

Company

  • About
  • Editorial policy
  • Contact
  • Terms
  • Privacy

© 2026 ExcelReady. All rights reserved.

  1. Blog
  2. Math
  3. How to Convert Units in Excel With the CONVERT Function

How to Convert Units in Excel With the CONVERT Function

By ExcelReady Team·Updated November 3, 2026·6 min read

The short answer

To convert units in Excel, use =CONVERT(number, from_unit, to_unit), for example =CONVERT(10,"mi","km") returns 16.09344. The unit codes go in double quotes and are case-sensitive, so "km" works but "KM" gives #N/A. You can also multiply or divide by a conversion factor stored in a locked cell, such as 1.609344 km per mile.

Key takeaways

  • CONVERT has three parts: the number, the unit it is in, and the unit you want, like =CONVERT(B2,"lbm","kg").
  • Unit codes are case-sensitive and must be in quotes: "km" works, "Km" and "KM" return #N/A.
  • Both units must measure the same thing. Converting miles to kilograms returns #N/A.
  • Wrap CONVERT in ROUND to get a tidy result, such as =ROUND(CONVERT(B2,"km","mi"),1).
  • Without CONVERT, multiply or divide by a factor in a cell locked with $ signs.
On this page+
  1. How the CONVERT function works
  2. Common unit codes for CONVERT
  3. Why does CONVERT return #N/A?
  4. How to round the converted result
  5. Put the unit codes in cells and fill down
  6. Convert units with a conversion factor instead
  7. Split a time conversion into whole units
  8. Practise it

To convert units in Excel, use the CONVERT function: =CONVERT(10,"mi","km") turns 10 miles into 16.09344 kilometres. It handles length, weight, temperature, volume, time and more, as long as you type the right unit codes. This guide lists the codes you'll use most, shows how to fix #N/A errors, and covers the backup method: multiplying by a conversion factor in a locked cell.

How the CONVERT function works#

CONVERT takes a number in one unit and returns it in another. It has three arguments (the parts inside the brackets):

Excel formula
=CONVERT(number, from_unit, to_unit)
PartWhat it meansExample
numberThe value to convert, or a cell that holds itB2
from_unitThe unit the number is in now, in quotes"mi"
to_unitThe unit you want, in quotes"km"

So =CONVERT(B2,"mi","km") reads as "take B2, which is in miles, and give it to me in kilometres". CONVERT is built into Excel 2007 and later on Windows and Mac, and in Microsoft 365.

Common unit codes for CONVERT#

The unit codes are short and case-sensitive. These are the ones most people need:

MeasureUnits and codes
Lengthmetre "m", kilometre "km", centimetre "cm", inch "in", foot "ft", yard "yd", mile "mi"
Weightgram "g", kilogram "kg", pound "lbm", ounce "ozm"
TemperatureCelsius "C", Fahrenheit "F", Kelvin "K"
Volumelitre "l", millilitre "ml", US gallon "gal", US fluid ounce "oz"
Timeyear "yr", day "day", hour "hr", minute "mn", second "sec"

Codes like "km" and "ml" are a metric prefix (k for kilo, m for milli, c for centi) joined to a base unit. Note the two ounces: "ozm" is weight and "oz" is fluid volume.

Here is CONVERT on everyday conversions:

FormulaResult
=CONVERT(10,"mi","km")16.09344
=CONVERT(5,"ft","m")1.524
=CONVERT(150,"lbm","kg")68.0388555
=CONVERT(68,"F","C")20
=CONVERT(2,"gal","l")7.570823568
=CONVERT(90,"mn","hr")1.5

When you type =CONVERT( and the first comma, Excel shows a list of units you can pick from, which helps you avoid typos.

Why does CONVERT return #N/A?#

CONVERT returns #N/A when it doesn't recognise a unit or can't convert between the two. Check these in order:

  1. Capitals. "KM" and "Kg" fail. Use "km" and "kg". Temperature codes are capitals: "C" and "F".
  2. Different kinds of unit. =CONVERT(5,"ft","kg") fails, because length can't become weight.
  3. Spelling. "lb" and "oz" look right but aren't the weight codes. Pounds are "lbm", weight ounces "ozm".
  4. Missing quotes. =CONVERT(B2,mi,km) gives #NAME?, because Excel reads mi as a name.

If the number itself is text, such as "10 miles", CONVERT returns #VALUE!. Put the number in one cell and the unit in another.

How to round the converted result#

CONVERT returns every decimal place, which is too many for most reports. Wrap it in ROUND to keep the number of decimals you want:

Excel formula
=ROUND(CONVERT(B2,"lbm","kg"),1)

If B2 holds 150, the result is 68, because 68.0388555 rounds to 68.0. The second argument of ROUND is the number of decimal places. The ROUND function guide shows the syntax, and the article on ROUND, ROUNDUP and ROUNDDOWN explains when to round up or down instead.

ROUND changes the stored value. If you only want the display tidier, use Decrease Decimal on the Home tab instead, and the full value stays in the cell.

Put the unit codes in cells and fill down#

To convert a whole column, keep the unit codes in their own cells and lock them with $. Say E1 holds km and F1 holds mi (typed without quotes in the cells). In C2:

Excel formula
=CONVERT(B2,$E$1,$F$1)

Fill it down (Windows: Ctrl+D; Mac: ⌘D). B2 has no $, so it moves to B3, B4 and so on. $E$1 and $F$1 are absolute references: they stay fixed as you fill. To switch a whole report to other units, change E1 and F1, not every formula.

Convert units with a conversion factor instead#

You can convert units in any spreadsheet by multiplying or dividing by a conversion factor. This works when a unit isn't in CONVERT's list, or when the file must work in other tools. Some factors are exact by definition:

ConversionFactorFormula (value in B2)
Miles to km1 mile = 1.609344 km=B2*1.609344
Km to milesdivide by the same factor=B2/1.609344
Pounds to kg1 lb = 0.45359237 kg=B2*0.45359237
Inches to cm1 in = 2.54 cm=B2*2.54
°F to °Csubtract 32, then × 5/9=(B2-32)*5/9

Rather than typing the factor into every formula, put it in one cell and lock it. If E2 holds 1.609344, then =ROUND(B5/$E$2,1) turns a 42.195 km marathon into 26.2 miles. The exercise on this page uses exactly that. The guides on the multiply formula and the divide formula cover the basics, and a conversion factor is really a fixed ratio, like those in how to calculate a ratio.

Temperature is the exception: you can't just multiply, because the scales start at different points. Use CONVERT or the full formula above.

Split a time conversion into whole units#

Some conversions need a whole part and a remainder, such as 135 minutes as "2 hours 15 minutes". Divide for the whole part, and use MOD for what is left:

Excel formula
=INT(B2/60)&" h "&MOD(B2,60)&" min"

With 135 in B2, the result is 2 h 15 min. INT keeps the whole hours and MOD returns the remainder after dividing by 60. The same pattern turns inches into feet and inches, with 12 instead of 60. The guide to MOD and INT has more examples.

Practise it#

Unit conversion is simple maths, so job tests use it to check that you can write a clean formula and lock a reference. Practise your first formulas in a live spreadsheet, then practise absolute references so a factor like $E$2 stays put when you fill down. Each lesson checks your formula instantly, and the exercise on this page is a quick warm-up.

Try it yourself

This is a live spreadsheet. Type the formula in the green cell and press Enter.

E2 holds the number of kilometres in one mile. In C5, convert the marathon distance in B5 to miles: divide by the locked factor $E$2 and round to 1 decimal place.

fx
ABCDEF
1
Race
Km
Miles
Km per mile
2
5K
5
1.609344
3
10K
10
4
Half marathon
21.0975
5
Marathon
42.195
6
7
8

Tip: Divide the kilometres by the factor, then wrap it all in ROUND with 1 as the second argument: =ROUND(B5/$E$2,1).

Practise this in a lesson

LessonFreeYour first formulasType values, write formulas that start with =, and see how they recalculate.LessonRelative vs absolute references ($)Lock a cell with $ so it doesn't move when you copy a formula, one of the most-tested Excel skills.Function guideROUNDRound to decimals, whole numbers or the nearest thousand with Excel's ROUND. Learn when formatting isn't enough, then practice live.

Frequently asked questions

Is there a formula to convert units in Excel?

+

Yes. CONVERT changes a number from one unit to another, for example =CONVERT(5,"ft","m") returns 1.524. It covers length, weight, temperature, volume, time, area, speed, energy and more.

Why does CONVERT return #N/A?

+

Usually a unit code is wrong. Codes are case-sensitive, so check capitals, spelling and quotes. CONVERT also returns #N/A when the two units measure different things, such as feet and kilograms.

How do I convert Fahrenheit to Celsius in Excel?

+

Use =CONVERT(A2,"F","C"). For 68 °F it returns 20. Without CONVERT, the formula is =(A2-32)*5/9.

What is the CONVERT code for pounds?

+

Use "lbm" for pounds (pound mass) and "kg" for kilograms. So =CONVERT(150,"lbm","kg") returns about 68.04. Ounces by weight are "ozm".

How do I convert minutes to hours in Excel?

+

Divide by 60, as in =A2/60, or use =CONVERT(A2,"mn","hr"). Both turn 90 minutes into 1.5 hours.

Sources

  • ROUND function - Microsoft Support
  • Switch between relative, absolute, and mixed references - Microsoft Support

Written and checked by the ExcelReady Team. First published November 3, 2026. The practice exercise runs in the same formula engine as our lessons. Found a mistake? Read our editorial policy or email hello@excelready.app.

On this page

  1. How the CONVERT function works
  2. Common unit codes for CONVERT
  3. Why does CONVERT return #N/A?
  4. How to round the converted result
  5. Put the unit codes in cells and fill down
  6. Convert units with a conversion factor instead
  7. Split a time conversion into whole units
  8. Practise it

Keep reading

Math· 6 min read

MOD and INT in Excel: Remainders and Whole Numbers

MOD returns the remainder after division: =MOD(127,12) gives 7, because 12 goes into 127 ten times with 7 left over. INT rounds a number down to a whole number: =INT(127/12) gives 10. Use them together to split a quantity into full groups and what's left, such as boxes and spare items, or hours and minutes.

Math· 6 min read

How to Round Numbers in Excel (ROUND, ROUNDUP, ROUNDDOWN)

Use =ROUND(number, digits) to round to a set number of decimal places, so =ROUND(B2,2) turns 3.4567 into 3.46. ROUNDUP always rounds away from zero and ROUNDDOWN always rounds towards zero, using the same two arguments. Unlike number formatting, these functions change the stored value that later formulas use.

Math· 7 min read

How to Calculate a Ratio in Excel

To calculate a ratio in Excel, divide the first number by the second: =B2/C2 returns 20 when 240 students share 12 teachers. To show it as a ratio, join the result to text: =ROUND(B2/C2,1)&":1" displays 20:1. For a simplified whole-number ratio such as 16:9, divide both numbers by their GCD.

More on math

  • Find the Correlation Between Two Columns in Excel
  • How to Calculate Cost per Unit in Excel
  • COUNT, COUNTA and COUNTBLANK: Counting Cells in Excel
  • How to Calculate Cumulative Percentage in Excel
  • How to Calculate Customer Lifetime Value (CLV) in Excel
  • Calculate Depreciation in Excel: Straight-Line, DB and DDB
All math articles →

Don't just read about Excel. Do it.

Practise real formulas in a live spreadsheet with instant feedback, right in your browser. Nothing to download.

Start learning for free