22.3 CONVERT Function
Perhaps you recall our recent coverage of the CONVERT function. It is a very powerful function that can convert between many units of measurement. The function takes as inputs three parameters. Those parameters are:
The value you want to convert
The From_unit, or the unit of measurement that your value currently represents
The To_unit, or the unit of measurement you’d like to convert your original value to
An example formula utilizing the CONVERT function would look similar to this:
=CONVERT($D$12,"mi","km")
This would convert the value listed in cell D12 from a mileage unit to kilometers.
Please note that the CONVERT function arguments are case-sensitive. Take a look at the help file for the function by clicking on the fx symbol just next to the function input, opening the Function dialog box, and then clicking the link “Help on this function.”
Listed in the help file are all of the measurement systems available within the CONVERT function. The From_unit and To_unit values are listed in quotations, and they must be an exact match when used as arguments in your function. Also listed are the available prefixes that may be added in front of any of the units of measurement.
Let’s review another example. Say we want to convert square yards to square feet. How might we do that? Well, we can embed the CONVERT function inside of another CONVERT function. The formula might look something like this:
=CONVERT(CONVERT($D$20,"yd","ft"),"yd","ft")
To test this, place a value in cell D20 of a spreadsheet and then evaluate the formula to step through how Excel evaluates each portion of the formula. An abbreviated method to accomplish this utilizes "yd^2" and "ft^2". That formula would look something like the following:
=CONVERT(D21,"yd^2","ft^2")
Do you see how short that formula is? It accomplishes quite a lot in just one abbreviated formula, thanks to the available arguments for the CONVERT function.