# Excel CONVERT Function Made Easy

Do you ever use the Excel CONVERT function? Do you avoid it, 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.

Then, enter a quantity.

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

And 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.

### 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.

### See the Converted Quantity

In the final cell, a formula checks for entries in the From and To unit cells, then converts the quantity. It uses the quantity, prefix codes, and unit codes.
=IF(COUNTA(D10,D14)<2,””, CONVERT(D6,E9&E10,E13&E14))

### 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.