Converting feet inches e g 5 ft 1 in to decimal feet using VBA or Excel

0 votes

I have a database with a few columns that store height data in the following format...

8 ft 4 in

5 ft 1 in

8 ft 6 in

12 ft 0 in

and so forth, for a total of more than 20,000 records spread across three columns. I need to do this conversion to decimal feet using either a VBA module or an excel formula. I don't know where I'm going wrong, but I've modified another VBA script I used to convert coordinates specified in degrees minutes seconds to decimal degrees

Function ConvertFtInches(pInput As String) As Double
'Updateby20140227
Dim xFt As Double
Dim xIn As Double
xFt = Val(Left(pInput, InStr(1, pInput, " ft") - 1))
xIn = Val(Mid(pInput, InStr(1, pInput, " ft") + 2, _
             InStr(1, pInput, " in") - InStr(1, pInput, _
             " ft") - 2)) / 12
ConvertFtInches = xFt + xIn
End Function

As a rookie with VBA, I could be completely wrong. Given that it is an adaption from another script, there is undoubtedly a problem with the script. There might be a simpler Excel formula available.

I'm hoping someone can assist. The conversions for values that are not formatted similarly to mine are included in all the other discussions.

Nov 2 in Others by Kithuzzz
• 20,660 points
25 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Others

0 votes
0 answers

MS EXCEL: Convert (Height) Decimal Feet & Inches to Inches Only

Using MS Excel (2010), I would like ...READ MORE

Feb 10 in Others by Edureka
• 13,640 points
83 views
0 votes
1 answer
0 votes
1 answer

How to print an Excel Sheet using VBA with Nitro PDF Creator in Excel 2016

you can use the built-in excel facilities ...READ MORE

answered Sep 24 in Others by narikkadan
• 37,660 points
110 views
0 votes
1 answer

Converting Feet-Inches to Inches Excel

We must parse the data because these ...READ MORE

answered Oct 15 in Others by narikkadan
• 37,660 points
51 views
0 votes
1 answer

Excel Formula to convert from cm to inches and feet & round off to two digits

Use the TEXT function to format, and ...READ MORE

answered Oct 15 in Others by narikkadan
• 37,660 points
35 views
0 votes
0 answers

Convert Rows to Columns with values in Excel using custom format

1 I having a Excel sheet with 1 ...READ MORE

Feb 17 in Others by Edureka
• 13,640 points
101 views
0 votes
1 answer

Remove formulas from all worksheets in Excel using VBA

Try this : Option Explicit Sub test1() ...READ MORE

answered Oct 3 in Others by narikkadan
• 37,660 points
81 views
0 votes
1 answer

Calculate monthly average from daily data without PivotTable

Assuming you have the months in column D enter ...READ MORE

answered Oct 3 in Others by narikkadan
• 37,660 points
65 views
0 votes
1 answer

Automate compound annual growth rate (CAGR) calculation

The following PowerPivot DAX formulas worked for ...READ MORE

answered Oct 7 in Others by narikkadan
• 37,660 points
71 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP