Excel CONVERT Function Made Easy

Excel CONVERT Function Made Easy

Do you ever use the Excel CONVERT function? Or, do you avoid that function, because you can’t remember all the measurement unit codes?

For example, the formula =CONVERT(10,”klt”,”gal”) will convert 10 kilolitres to 2,641.7205 gallons – if you get those codes right.

You might be able to remember lt and gal, but probably not many of the other codes.

Drop Down Lists of Units

To make the CONVERT function easy to use, I created an Excel file, with lists of the unit categories, codes and the prefixes.

First, you’ll select a conversion type, from a drop down list of unit categories.

Drop down list of unit categories
Drop down list of unit categories

What Quantity?

Then, enter a quantity.

convertfunction02b

Choose a Prefix

Next, you can select a prefix, if applicable, from a drop down list.

Choose Prefix from drop down list
Choose Prefix from drop down list

Choose Unit Type (From)

Nexce, select the unit type, from the next drop down list.

This list only shows the items for the Conversion Type that you selected.

The instructions for this technique can be found on the Dependent Data Validation From a Sorted List page.

Choose Unit Type from drop down list
Choose Unit Type from drop down list

Select the Conversion Units

After you have selected the starting unit type, select the prefix and units for the converted quantity.

In this example, we’re converting kilolitres to gallons, and you can see the CONVERT function unit codes at the right of the unit names.

converting kilolitres to gallons
converting kilolitres to gallons

See the Converted Quantity

In the final cell, a formula checks for entries in the From and To unit cells, then converts the quantity.

The formula uses the quantity, prefix codes, and unit codes.

=IF(COUNTA(D10,D14)<2,””, CONVERT(D6,E9&E10,E13&E14))

convertfunction05

Excel VBA Code Clears Cells

You can use this workbook without macros, but if you enable macros, the data entry cells will be cleared, when you select a Conversion Type.

To see the event code that clears the cells, right-click on the sheet tab, and click View Code.

convertfunction06

Get the Excel CONVERT Function Workbook

To test the CONVERT function, and see how the data validation drop down lists work, you can download the sample file from the Contextures website.

Go to the Excel Sample Files page, and in the Functions section, look for: FN0022 CONVERT Function Made Easy.

The file is in xlsm format, and zipped. The workbook contains a macro, so enable macros if you want to automatically clear the data entry cells.

NOTE: The Conversion sheet is protected, with no password.
_________________

10 thoughts on “Excel CONVERT Function Made Easy”

Leave a Reply to Gregory Cancel reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.