CONVERT Function – Convert Units in Excel, VBA, Google Sheets

Written by

Editorial Team

Reviewed by

Steve Rynearson

Last updated on November 6, 2023
Download Example Workbook

Download the example workbook

This Tutorial demonstrates how to use the CONVERT Function in Excel to convert a number from one unit to another.

CONVERT Main Function

CONVERT Function 

The CONVERT Function converts a number from a measurement system to another. Say, you want to convert miles into kilometers.

=CONVERT(C3, "km", "mi")

CONVERT Function 01

CONVERT Function – Prefixes

The CONVERT Function can also convert from one prefix to another. 

=CONVERT(C3, "sec", "msec")

CONVERT Function 02

Note: The prefix will proceed the unit in the formula.

CONVERT Function – Binary Prefixes

The CONVERT Function can be used for binary prefixes as well.

=CONVERT(C3, "Mibyte", "Gbyte")

CONVERT Function 03

CONVERT Function – Area/Volume

The CONVERT Function can also convert compound units like meter squared or cubic feet.

=CONVERT(CONVERT(C3, "ft", "mi"), "ft", "mi")

CONVERT Function 04

Alternatively, the units can be directly entered in the formula.

=CONVERT(C3, "ft2", "mi2")

CONVERT Function 05

CONVERT Function – Incorrect Data Type

The CONVERT Function will return an error if the input data type is not the same.

=CONVERT(C3, "g", "hr")

CONVERT Function 06

CONVERT in Google Sheets

The CONVERT Function works exactly the same in Google Sheets as in Excel:

CONVERT Google Function

CONVERT Examples in VBA

You can also use the CONVERT function in VBA. Type:

application.worksheetfunction.convert(number,from_unit,to_unit)

For the function arguments (number, etc.), you can either enter them directly into the function, or define variables to use instead.

AI Formula Generator

Try for Free

Excel Practice Worksheet

practice excel worksheet

Practice Excel functions and formulas with our 100% free practice worksheets!

  • Automatically Graded Exercises
  • Learn Excel, Inside Excel!

Free Download

Return to List of Excel Functions