CONVERT (unit conversion)

<< Click to Display Table of Contents >>

CONVERT (unit conversion)

Syntax:

CONVERT(Number, From, To)

Description:

This converts a Number from one unit to another.

From and To are codes that represent the source unit and target unit (see table below).

Both units have to be in the same category. For example, you can convert meters into miles but not into minutes, of course.

An error value #N/A is displayed if a) From and To are not from the same category or b) one of the two unit codes was specified incorrectly.

Note: Unit codes are case-sensitive!

The following unit codes are available:

Mass

Code

Gram

g

Slug (unit of mass)

sg

Pound* (avoirdupois)

lbm

u (atom mass)

u

Ounce (avoirdupois)

ozm

*Does not correspond to the pound still partly used in German-speaking countries (½ kilo)

 

 

 

Distance

Code

Meter

m

Statute mile

mi

Nautical mile

Nmi

Inch

in

Foot

ft

Yard

yd

Ångström

ang

Pica

Pica

Light year

ly

Parsec (parallax second)

parsec

 

 

Time

Code

Second

sec

Minute

mn

Hour

hr

Day

day

Year*

yr

Fortnight**

ftn

*Based on a year with 365.25 days

 

**This unit is not supported by Microsoft Excel.

 

 

 

Liquid measure

Code

Liter

l (lowercase "L")

Teaspoon

tsp

Tablespoon

tbs

Fluid ounce

oz

Cup

cup

Pint (U.S.)

pt

Pint (U.K.)

uk_pt

Quart

qt

Gallon

gal

 

 

Force

Code

Newton

N

Dyne

dyn

Pound-force

lbf

 

 

Power

Code

Watt

W

HP (Horsepower)

HP

 

 

Magnetism

Code

Tesla

D

Gauss

ga

 

 

Energy

Code

Joule

J

Erg

e

Thermodynamic calorie

c

IT calorie

cal

Electron volt

eV

Horsepower-hour

HPh

Watt-hour

Wh

Foot-pound force

flb

BTU (British Thermal Unit)

BTU

 

 

Pressure

Code

Pascal

Pa

Atmosphere

atm

mm of Mercury

mmHg

 

 

Temperature

Code

Degree Fahrenheit

F

Degree Celsius

C

Degree Kelvin

K

Furthermore, prefixes can be added to metric units, "mg", for instance, stands for milligrams.

Please pay close attention to capitalization here also!

The following prefixes are available:

Prefix (and factor)

Code

Exa (10^18)

E

Peta (10^15)

P

Tera (10^12)

D

Giga (10^9)

G

Mega (10^6)

M

Kilo (1000)

k

Hecto (100)

h

Deka (10)

e

Deci (0.1)

d

Centi (0.01)

c

Milli (0.001)

m

Micro (10^-6)

u

Nano (10^-9)

n

Pico (10^-12)

p

Femto (10^-15)

f

Atto (10^-18)

a

Example:

CONVERT(1, "day", "sec") returns 86400 (days ‑> seconds)

CONVERT(1, "mi", "km") returns 1.60934 (miles ‑> kilometers)

CONVERT(100, "kW", "HP") returns 134.10201 (100 kW ‑> HP)

CONVERT(1, "aparsec", "cm") returns 3.08568 (Attoparsec ‑> cm)