What Is CONVERT Function In Excel?
The CONVERT function in Excel helps users to convert a numeric value’s measuring unit to another, such as miles to kilometers, kilograms to grams, pounds to dollars, etc., or vice versa. The CONVERT Excel function is an inbuilt Engineering function, so we can insert the formula from the “Function Library” or enter it directly in the worksheet.
For example, the below table contains a list of numbers and their respective units in columns A and B.
📥Download the ready-to-use Excel template to practice this tutorial yourself.
Download Excel TemplateFrequently Asked Questions (FAQs)
The CONVERT function is in the Formulas tab. We must click Formulas → More Functions → Engineering → CONVERT to apply it in the required cell.
We can utilize the CONVERT() in Excel VBA using the method:
Application.WorksheetFunction.Convert(number,from_unit,to_unit)
For example, the below table contains a list of numbers and their respective units in columns A and B.
The steps to convert the given values using the CONVERT() in Excel and VBA are,
• 1: In the worksheet with the above table, press the keys Alt + F11 to open the VBA Editor.
• 2: Select the required VBAProject and select the option Insert → Module to open a new Module window, Module1.
• 3: Type the VBA code, as shown in the below image, in the Module1 window to apply the CONVERT() in the target cells.
Sub CONVERT_fn()
Range(“E2”) = Application.WorksheetFunction.Convert(Range(“A2”), Range(“B2”), Range(“C2”))
Range(“E3”) = Application.WorksheetFunction.Convert(Range(“A3”), Range(“B3”), Range(“C3”))
Range(“E4”) = Application.WorksheetFunction.Convert(Range(“A4”), Range(“B4”), Range(“C4”))
End Sub
• 4: Click the Run Sub/UserForm button in the top menu to execute the entered VBA code.
Once we execute the code, we will get the converted numbers in the corresponding target cells, as shown below.
We can convert inches to square feet by using the CONVERT function in Excel.
For example, the below table contains a list of values in inches.
The steps to convert values using the CONVERT function in Excel are,
• 1: First, to convert inches to square feet, we will determine the corresponding square inches value for each given inch value. So, select cell B2, enter the formula =A2*A2, and press Enter.
• 2: Drag the formula from cell B2 to B5 using the fill handle.
• 3: Next, to convert the square inches values to square feet values using the CONVERT(), select cell C2, enter the formula =CONVERT(B2,”in^2″,”ft^2″), and press Enter.
• 4: Drag the formula from cell C2 to C5 using the fill handle.
We get the output as shown above.
[Output Observation: The CONVERT() in each target cell takes the corresponding square inches value as the first argument. And the second and third arguments are in^2 and ft^2, the units for square inches and square feet.
Thus, the CONVERT() returns the respective square feet values in column C, based on the inputs.]
Download Template
📥Download the ready-to-use Excel template to practice this tutorial yourself.
Download Excel TemplateRecommended Articles
This has been a guide to CONVERT Function In Excel. Here we explain how to use CONVERT Formula along with examples and downloadable excel template. You can learn more from the following articles –