I am trying to convert the data in an Excel sheet from dms (degree-minute-second) to dd (decimal degree) format using the vba script available here.
Here is sample data:
53° 0' 39.31" 6° 44' 50.14"
52° 59' 51.43" 6° 46' 0.02"
In the Excel sheet, this code is working:
=Convert_Decimal("10° 27' 36""")
but this is not working:
=Convert_Decimal(B3).
The error is #value!
I want rows in excel in dd format. Alternatively I want to convert this Excel file into a database but the format must be dd.
Any suggestions anyone?
-
You might be right but that is NOT my question. Extracting the value from one cell of excel is precisely where the error is ... i have to convert over 32000 rows.Abhijit Gujar– Abhijit Gujar2014年08月18日 19:07:27 +00:00Commented Aug 18, 2014 at 19:07
-
Are the longitude and latitude values in separate fields?mkennedy– mkennedy2014年08月18日 19:31:43 +00:00Commented Aug 18, 2014 at 19:31
-
yes dms lat and long are in separate columnAbhijit Gujar– Abhijit Gujar2014年08月18日 19:36:52 +00:00Commented Aug 18, 2014 at 19:36
2 Answers 2
Are the longitude and latitude values in separate fields? Because the Convert_Decimal function requires a single value.
After trying this myself, I think you were trying to convert the DMS values to DD in-place. That is, in the same column. Instead, use the script in a new column, referring to the one you want to convert. See image below where I have a DMS value in column C, and calculating its DD value into column B.
Microsoft Excel 2013 calculating a DD value from DMS
-
Per gis.SE standards, question should probably be closed or migrated due to general (not really GIS-specific) content.mkennedy– mkennedy2014年08月18日 19:41:03 +00:00Commented Aug 18, 2014 at 19:41
-
mkenndy .. thanks for quick response and try . :) I appreciate .Abhijit Gujar– Abhijit Gujar2014年08月18日 19:53:33 +00:00Commented Aug 18, 2014 at 19:53
It worked
I guess the problem was in the "degree" symbol which i replaced with "~" in the excel sheet and also in the vba code and bang !!! It worked !!!
reference:
-
1Great! It's possible the original "degree" symbol wasn't really the correct one. There are characters that look like the degree symbol in some fonts and it's easy to confuse them.mkennedy– mkennedy2014年08月18日 19:56:56 +00:00Commented Aug 18, 2014 at 19:56
Explore related questions
See similar questions with these tags.